This script is not working as it should.
I need it to when the player is outsite of the door, he goes inside. And when se is inside, he goes outside.
And if he is not in front of the door, he receive a message.
Any ideas? Thanks!
- - - Updated - - -
Solved by myself! Thanks!
I need it to when the player is outsite of the door, he goes inside. And when se is inside, he goes outside.
And if he is not in front of the door, he receive a message.
Lua:
function onUse(cid, item, frompos, item2, topos)
local posdentro = {x=32293, y=32293, z=7}
local posfora = {x=32295, y=32293, z=7}
if (getCreaturePosition(cid) == posfora) then
doTeleportThing(cid, posdentro)
doSendMagicEffect(posdentro, 10)
else
doPlayerSendTextMessage(cid, 22, "You must be in front of the door.")
elseif (getCreaturePosition(cid) == posdentro) then
doTeleportThing(cid, posfora)
doSendMagicEffect(posfora, 10)
else
doPlayerSendTextMessage(cid, 22, "You must be in front of the door.")
end
return true
end
Any ideas? Thanks!
- - - Updated - - -
Solved by myself! Thanks!
Last edited: