Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if that is what you are looking for , 4 prims 2 scripts,
- Contoller prim, 3 linked, middle(root) named HOME, right named "Right" , left named "Left"
- integer chan = -98780;
- default
- {
- state_entry()
- {
- }
- touch_start(integer num_detected)
- {
- if(llGetLinkName(llDetectedLinkNumber(0))=="Home")llRegionSay(chan,"*GoHome*");
- else if(llGetLinkName(llDetectedLinkNumber(0))=="Right")llRegionSay(chan,"*GoRight*");
- else if(llGetLinkName(llDetectedLinkNumber(0))=="Left")llRegionSay(chan,"*GoLeft*");
- }
- }
- -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 ..-
- -adjust variables as needed ..
- integer chan = -98780;
- vector home;
- float move = .5;
- default
- {
- on_rez(integer rez)
- {
- llSetObjectDesc("");
- llResetScript();
- }
- state_entry()
- {
- if(
- llGetObjectDesc() =="")
- {
- llSetObjectDesc((string)llGetPos());
- home = llGetPos();
- }
- else home= (vector)llGetObjectDesc();
- llListen(chan, "", "", "");
- }
- listen(integer chan, string obj, key id, string msg)
- {
- if (msg == "*GoHome*")llSetPos(home);
- else if (msg == "*GoLeft*")llSetPos(llGetPos()+<move,0,0>);
- else if (msg == "*GoRight*")llSetPos(llGetPos()-<move,0,0>);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement