Collider.lsl 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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:1863
  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. if (debug) llOwnerSay("Raccoon at bottom");
  19. llMessageLinked(LINK_SET,0, "@walk=<79.46262, 39.34087, 21.64303>","");
  20. }
  21. Reset()
  22. {
  23. llSetStatus(STATUS_PHANTOM, FALSE);
  24. llVolumeDetect(FALSE);
  25. llSleep(0.1);
  26. llVolumeDetect(TRUE);
  27. }
  28. default
  29. {
  30. state_entry()
  31. {
  32. llSetText("",<1,1,1>,1.0);
  33. Reset();
  34. llSetTimerEvent(3600);
  35. }
  36. collision_start(integer n) {
  37. if (! osIsNpc(llDetectedKey(0)))
  38. {
  39. if (debug) llOwnerSay("Collided with " + llKey2Name(llDetectedKey(0)));
  40. DoIt();
  41. }
  42. }
  43. timer()
  44. {
  45. llSetTimerEvent(3600);
  46. Reset();
  47. }
  48. on_rez(integer p)
  49. {
  50. llResetScript();
  51. }
  52. touch_start(integer p)
  53. {
  54. DoIt();
  55. }
  56. changed(integer what)
  57. {
  58. if (what & CHANGED_REGION_START)
  59. {
  60. llResetScript();
  61. }
  62. }
  63. }