Created
December 4, 2014 01:47
-
-
Save cinderblocks/4582919dcd3d37e4628d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integer attempts = 0; | |
default | |
{ | |
state_entry() | |
{ | |
llOwnerSay("Accept my permissions to start. Touch to stop."); | |
llRequestPermissions(llGetOwner(), PERMISSION_TELEPORT); | |
} | |
run_time_permissions(integer perm) | |
{ | |
if (~perm & PERMISSION_TELEPORT) | |
{ | |
llOwnerSay("I need permissions to teleport you!"); | |
llRequestPermissions(llGetOwner(), PERMISSION_TELEPORT); | |
} | |
else | |
{ | |
state activated; | |
} | |
} | |
} | |
state activated | |
{ | |
state_entry() | |
{ | |
llSetTimerEvent(3.0); | |
} | |
touch_start(integer touch_me_bb) | |
{ | |
if (llDetectedKey(0) == llGetOwner()) | |
state default; | |
} | |
state_exit() | |
{ | |
llSetTimerEvent(0.0); | |
} | |
timer() | |
{ | |
list agents = llGetAgentList(AGENT_LIST_REGION, []); | |
integer agent_count = llGetListLength(agents); | |
if (!agent_count) state default; | |
integer i; | |
integer found = FALSE; | |
for (i = 0; i < agent_count; ++i) | |
{ | |
if (llList2Key(agents,i) == llGetOwner()) | |
{ | |
llTeleportAgentGlobalCoords(llGetOwner(), <263168,324864,0>, <128,128,50>, ZERO_VECTOR); | |
llOwnerSay("Attempts: " + (string)(++attempts)); | |
found = TRUE; | |
} | |
} | |
if (!found) | |
state default; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment