Lava Titan
Developer
Hi can someone help me fixing this script I converted?
So far I got no errors in console but it's teleporting me to temple while all position spots are avaible...
Thanks in advance!
So far I got no errors in console but it's teleporting me to temple while all position spots are avaible...
Code:
local location = {
{x=480, y=463, z=8},
{x=484, y=463, z=8},
{x=488, y=463, z=8},
{x=500, y=479, z=8}
}
function onStepIn(cid, item, pos)
for i = 1, #location do
if getTopCreature(location[i]).uid > 0 then
playerteleported = 1
else
doTeleportThing(cid,location[i])
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome to the training monks! Open the door to leave.")
playerteleported = 0
break
end
end
if playerteleported > 0 then
doTeleportThing(cid, {x=469, y=471, z=8})
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "There was no empty training spot.")
end
return true
end
Code:
local location = {
{x = 994, y = 987, z = 4},
{x = 998, y = 987, z = 4},
{x = 1002, y = 987, z = 4},
{x = 1006, y = 987, z = 4}
}
function onStepIn(player, creature, item, position, fromPosition, toPosition)
for i = 1, #location do
local tile = creature:getTile()
if tile:getTopCreature(location[i]).uid > 0 then
playerteleported = 1
else
player:teleportTo(location[i])
player:sendTextMessage(MESSAGE_INFO_DESCR, "Welcome to the training monks! Open the door to leave.")
playerteleported = 0
break
end
end
if playerteleported > 0 then
local temple = Position(1000,1000,5)
player:teleportTo(temple)
player:sendTextMessage(MESSAGE_INFO_DESCR, "There was no empty training spot.")
end
return true
end
Thanks in advance!
Last edited: