vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
hi, i try create random tp after i click on item of id XXX but it not work ;/ its my code
I have 21 positions, if i click on item XXX match.random geting random pos and player get free teleport to XX pos
Code:
function onUse(cid, item, pos)
if cid > 0 then
if item.actionid == 10534 then
local location = {
{x=1163, y=883, z=7, stackpos=253},
{x=1167, y=883, z=7, stackpos=253},
{x=1169, y=883, z=7, stackpos=253},
{x=1172, y=883, z=7, stackpos=253},
{x=1162, y=885, z=7, stackpos=253},
{x=1164, y=885, z=7, stackpos=253},
{x=1171, y=885, z=7, stackpos=253},
{x=1173, y=885, z=7, stackpos=253},
{x=1162, y=887, z=7, stackpos=253},
{x=1164, y=887, z=7, stackpos=253},
{x=1171, y=887, z=7, stackpos=253},
{x=1173, y=887, z=7, stackpos=253},
{x=1163, y=889, z=7, stackpos=253},
{x=1167, y=889, z=7, stackpos=253},
{x=1169, y=889, z=7, stackpos=253},
{x=1172, y=889, z=7, stackpos=253},
{x=1165, y=891, z=7, stackpos=253},
{x=1167, y=891, z=7, stackpos=253},
{x=1169, y=891, z=7, stackpos=253},
{x=1171, y=891, z=7, stackpos=253},
{x=1173, y=891, z=7, stackpos=253}
}
local xd = math.random(1, #location)
local playerteleported = 1
for i=1,#location do
getplayer = getThingFromPos(location[i])
if getplayer == #location[i] then
if(value) == location[i] then
doTeleportThing(cid,{x=1168, y=893, z=7})
doPlayerSendTextMessage(cid,22,"[KillEvent] Boom!")
break
end
end
end
end
end
end
I have 21 positions, if i click on item XXX match.random geting random pos and player get free teleport to XX pos