Collision.lsl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // :SHOW:1
  2. // :CATEGORY:NPC
  3. // :NAME:Hypergrid Story Three
  4. // :AUTHOR:Ferd Frederix
  5. // :KEYWORDS:
  6. // :CREATED:2015-11-24 20:36:34
  7. // :EDITED:2015-11-24 19:36:34
  8. // :ID:1090
  9. // :NUM:1862
  10. // :REV:1
  11. // :WORLD:Opensim
  12. // :DESCRIPTION:
  13. // Sample collision script for NPC animator
  14. // :CODE:
  15. integer debug = FALSE;
  16. DoIt()
  17. {
  18. llMessageLinked(2,1, "@animate=avatar_type","");
  19. llMessageLinked(2,5, "@say=Be wary of the water, for it is deadly","");
  20. }
  21. Reset()
  22. {
  23. llVolumeDetect(FALSE);
  24. llSetStatus(STATUS_PHANTOM, FALSE);
  25. llSleep(0.1);
  26. llVolumeDetect(TRUE);
  27. }
  28. default
  29. {
  30. state_entry()
  31. {
  32. llSetText("",<1,1,1>,1.0);
  33. llSetTimerEvent(3600);
  34. Reset();
  35. }
  36. collision_start(integer n) {
  37. if (debug) llOwnerSay("Collided with " + llKey2Name(llDetectedKey(0)));
  38. if (! osIsNpc(llDetectedKey(0)))
  39. {
  40. if (debug) llOwnerSay("Collided with " + llKey2Name(llDetectedKey(0)));
  41. DoIt();
  42. }
  43. }
  44. timer()
  45. {
  46. Reset();
  47. llSetTimerEvent(3600);
  48. }
  49. on_rez(integer p)
  50. {
  51. llResetScript();
  52. }
  53. changed(integer what)
  54. {
  55. if (what & CHANGED_REGION_START)
  56. {
  57. llResetScript();
  58. }
  59. }
  60. }