Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. if that is what you are looking for , 4 prims 2 scripts,
  2.  
  3. Contoller prim, 3 linked, middle(root) named HOME, right named "Right" , left named "Left"
  4.  
  5. integer chan = -98780;
  6.  
  7.  
  8. default
  9. {
  10. state_entry()
  11. {
  12.  
  13. }
  14. touch_start(integer num_detected)
  15. {
  16. if(llGetLinkName(llDetectedLinkNumber(0))=="Home")llRegionSay(chan,"*GoHome*");
  17. else if(llGetLinkName(llDetectedLinkNumber(0))=="Right")llRegionSay(chan,"*GoRight*");
  18. else if(llGetLinkName(llDetectedLinkNumber(0))=="Left")llRegionSay(chan,"*GoLeft*");
  19. }
  20. }
  21.  
  22.  
  23.  
  24. -In the box you want to move, it will store it's HOME position in it's description, and reset it on rez, if you want to change it's home, just clear the object description, and reset the script ..-
  25.  
  26. -adjust variables as needed ..
  27.  
  28.  
  29. integer chan = -98780;
  30. vector home;
  31. float move = .5;
  32. default
  33. {
  34. on_rez(integer rez)
  35. {
  36. llSetObjectDesc("");
  37. llResetScript();
  38.  
  39. }
  40.  
  41.  
  42. state_entry()
  43. {
  44. if(
  45. llGetObjectDesc() =="")
  46. {
  47. llSetObjectDesc((string)llGetPos());
  48. home = llGetPos();
  49. }
  50. else home= (vector)llGetObjectDesc();
  51. llListen(chan, "", "", "");
  52. }
  53. listen(integer chan, string obj, key id, string msg)
  54. {
  55. if (msg == "*GoHome*")llSetPos(home);
  56. else if (msg == "*GoLeft*")llSetPos(llGetPos()+<move,0,0>);
  57. else if (msg == "*GoRight*")llSetPos(llGetPos()-<move,0,0>);
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement