Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector homepos;
- rotation homerot;
- list points;
- list rots;
- key av = NULL_KEY;
- integer tp;
- integer line;
- default
- {
- state_entry()
- {
- homepos = llGetPos();
- homerot = llGetRot();
- llSitTarget(<0,0,0.1>, ZERO_ROTATION);
- llForceMouselook(1);
- if(llGetInventoryNumber(INVENTORY_NOTECARD) > 0) llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD, 0), line);
- }
- changed(integer c)
- {
- if(c&CHANGED_LINK)
- {
- av = llAvatarOnSitTarget();
- if(av != NULL_KEY)
- {
- if(points != []) llSetRegionPos((vector)llList2Vector(points,tp));
- if(rots != []) llSetRot((rotation)llList2Rot(rots,tp)); // sleep on this helps
- llUnSit(av);
- //llTriggerSound("cfc3f5be-0a6a-0d36-5b7e-c5c040275037",1);
- llSetRot(homerot); // for the sleep
- llSetRegionPos(homepos);
- tp++;
- if(tp >= llGetListLength(points)) tp = 0;
- }
- }
- else if(c&CHANGED_INVENTORY)
- {
- if(llGetInventoryNumber(INVENTORY_NOTECARD) > 0)
- {
- points = [];
- rots = [];
- line = 0;
- llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD, 0), line);
- }
- }
- else if(c&CHANGED_REGION_START) llResetScript();
- }
- dataserver(key id, string d)
- {
- if(d != "")
- {
- list data = llCSV2List(d);
- points += [(vector)llList2String(data,0)];
- rots += [(rotation)llList2String(data,1)];
- line++;
- llGetNotecardLine(llGetInventoryName(INVENTORY_NOTECARD, 0), line);
- }
- else
- {
- llOwnerSay((string)llGetListLength(points) + " teleports loaded");
- tp = llAbs(llRound(llFrand(llGetListLength(points)))-1);
- }
- }
- on_rez(integer sp)
- {
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement