Hi, I use this script, you walk into the tp and get teleported to an empty spot in training room. but nothing happens when i walk into the tp, what do i need to? what to do with playerposition = {x=400, y=400, z=7, stackpos=253}
?
?
Lua:
function onStepIn(cid, item, pos)
if cid > 0 then
if item.actionid == 30001 then
if(item.itemid == 5024) then
local location = {
{x=32067, y=32162, z=7, stackpos=253},
{x=32071, y=32162, z=7, stackpos=253},
{x=32075, y=32162, z=7, stackpos=253},
{x=32079, y=32162, z=7, stackpos=253},
{x=32083, y=32162, z=7, stackpos=253},
{x=32087, y=32162, z=7, stackpos=253},
{x=32091, y=32162, z=7, stackpos=253},
{x=32095, y=32162, z=7, stackpos=253},
{x=32099, y=32162, z=7, stackpos=253},
{x=32103, y=32162, z=7, stackpos=253},
{x=32107, y=32162, z=7, stackpos=253},
{x=32067, y=32172, z=7, stackpos=253},
{x=32071, y=32172, z=7, stackpos=253},
{x=32075, y=32172, z=7, stackpos=253},
{x=32079, y=32172, z=7, stackpos=253},
{x=32083, y=32172, z=7, stackpos=253},
{x=32087, y=32172, z=7, stackpos=253},
{x=32091, y=32172, z=7, stackpos=253},
{x=32095, y=32172, z=7, stackpos=253},
{x=32099, y=32172, z=7, stackpos=253},
{x=32103, y=32172, z=7, stackpos=253},
{x=32107, y=32172, z=7, stackpos=253},
{x=32068, y=32162, z=8, stackpos=253},
{x=32072, y=32162, z=8, stackpos=253},
{x=32076, y=32162, z=8, stackpos=253},
{x=32080, y=32162, z=8, stackpos=253},
{x=32084, y=32162, z=8, stackpos=253},
{x=32088, y=32162, z=8, stackpos=253},
{x=32092, y=32162, z=8, stackpos=253},
{x=32096, y=32162, z=8, stackpos=253},
{x=32100, y=32162, z=8, stackpos=253},
{x=32104, y=32162, z=8, stackpos=253},
{x=32108, y=32162, z=8, stackpos=253},
{x=32068, y=32172, z=8, stackpos=253},
{x=32072, y=32172, z=8, stackpos=253},
{x=32076, y=32172, z=8, stackpos=253},
{x=32080, y=32172, z=8, stackpos=253},
{x=32084, y=32172, z=8, stackpos=253},
{x=32088, y=32172, z=8, stackpos=253},
{x=32092, y=32172, z=8, stackpos=253},
{x=32096, y=32172, z=8, stackpos=253},
{x=32100, y=32172, z=8, stackpos=253},
{x=32104, y=32172, z=8, stackpos=253},
{x=32108, y=32172, z=8, stackpos=253},
{x=32066, y=32162, z=7, stackpos=253},
{x=32070, y=32162, z=7, stackpos=253},
{x=32074, y=32162, z=7, stackpos=253},
{x=32078, y=32162, z=7, stackpos=253},
{x=32082, y=32162, z=7, stackpos=253},
{x=32086, y=32162, z=7, stackpos=253},
{x=32090, y=32162, z=7, stackpos=253},
{x=32094, y=32162, z=7, stackpos=253},
{x=32098, y=32162, z=7, stackpos=253},
{x=32102, y=32162, z=7, stackpos=253},
{x=32106, y=32162, z=7, stackpos=253},
{x=32066, y=32172, z=7, stackpos=253},
{x=32070, y=32172, z=7, stackpos=253},
{x=32074, y=32172, z=7, stackpos=253},
{x=32078, y=32172, z=7, stackpos=253},
{x=32082, y=32172, z=7, stackpos=253},
{x=32086, y=32172, z=7, stackpos=253},
{x=32090, y=32172, z=7, stackpos=253},
{x=32094, y=32172, z=7, stackpos=253},
{x=32098, y=32172, z=7, stackpos=253},
{x=32102, y=32172, z=7, stackpos=253},
{x=32106, y=32172, z=7, stackpos=253}
}
playerposition = {x=32366, y=32236, z=7, stackpos=253}
i2 = 0
local playerteleported = 1
for i=0,23 do
i2 = i2 +1
getplayer = getThingfromPos(location[i2])
if getplayer.itemid > 0 then
playerteleported = 1
else
doTeleportThing(cid,location[i2])
playerteleported = 0
break
end
end
if playerteleported > 0 then
doTeleportThing(cid,{x=32369, y=32241, z=7})
doPlayerSendTextMessage(cid,22,"There was no empty training spot.")
end
end
end
end
end
Last edited by a moderator: