Hello!
I'm trying to make so then a player steps on a sqm he gets teleported to random places. And after looking at some ppls code at the forum i got that to work. But if a player already standing on the sqm there the next is about to get teleported to i want it to randomize again so the player gets to a empty spot.
Hope you understand what i mean!
Here is my code so far:
I'm trying to make so then a player steps on a sqm he gets teleported to random places. And after looking at some ppls code at the forum i got that to work. But if a player already standing on the sqm there the next is about to get teleported to i want it to randomize again so the player gets to a empty spot.
Hope you understand what i mean!
Here is my code so far:
Code:
function onStepIn(cid, item, pos)
if cid > 0 then
if item.actionid == 30001 then
if(item.itemid == 5024) then
local location = {
{x=480, y=463, z=8},
{x=484, y=463, z=8},
{x=488, y=463, z=8},
{x=492, y=463, z=8},
{x=496, y=463, z=8},
{x=500, y=463, z=8}
}
lugar = math.random(1,6)
doTeleportThing(cid,location[lugar])
doPlayerSendTextMessage(cid,22,"Welcome to the training monks! To get out go in to the blue teleport.")
doPlayerSendTextMessage(cid,21,"Do not macro train, you will get banned!")
end
end
end
end