Magictibiaman
New Member
- Joined
- May 25, 2009
- Messages
- 371
- Reaction score
- 0
i am trying to make it so every 30 seconds a person gets teleported from a square using a global event
i'm close but what have i done wrong?
i'm close but what have i done wrong?
Code:
function onThink(interval, lastExecution)
random = math.random(0,3)
local pos = {x=502, y=510, z=8, stackpos=253}
if(random == 0) then
pos = {x=502, y=510, z=8, stackpos=253}
elseif(random == 1) then
pos = {x=497, y=505, z=8, stackpos=253}
elseif(random == 2) then
pos = {x=507, y=505, z=8, stackpos=253}
elseif(random == 3) then
pos = {x=502, y=501, z=8, stackpos=253}
end
player1pos = {x=524, y=522, z=7, stackpos=253}
player1 = getThingfromPos(player1pos)
doTeleportThing(player1.uid,pos)
return TRUE
end