door is not teleporting players to the right position 
my doorvip.lua
this is what happens if i try to go from bottom to top
Before i use it:

After i use it:

This is what happens if i try to go from top to bottom:
Before i use it:

After i use it:

i dont get any errors in the distro :l please help me
my doorvip.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cidPosition = getCreaturePosition(cid)
if (item.actionid == 5788 and getPlayerStorageValue(cid,13500) >= 1) then
if cidPosition.x < toPosition.x then
doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Bem-vindo a area VIP!", TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Bem-vindo a area VIP", TALKTYPE_ORANGE_1)
end
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao possui Vip Access.")
return TRUE
end
return FALSE
end
Before i use it:

After i use it:

This is what happens if i try to go from top to bottom:
Before i use it:

After i use it:

i dont get any errors in the distro :l please help me
Last edited: