This is my script, i'm trying to replicate the cipsoft door system, but i'm not succeeding i'm having difficulty with the logic and how to apply it in the script
I recorded a video on the original server to better understand the mechanism, could someone help me with this? I've been trying for some time
Video
thank you very much in advance
Lua:
door = openHorizontalDoors[item:getId()]
if door then
local doorCreature = Tile(toPosition):getTopCreature()
if doorCreature ~= nil then
toPosition.x = toPosition.x + 1
local query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
if query ~= RETURNVALUE_NOERROR then
toPosition.x = toPosition.x - 1
toPosition.y = toPosition.y + 1
query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
end
if query ~= RETURNVALUE_NOERROR then
player:sendTextMessage(MESSAGE_STATUS_SMALL, query)
return true
end
doorCreature:teleportTo(toPosition, true)
end
item:transform(door, 1)
item:decay()
end
I recorded a video on the original server to better understand the mechanism, could someone help me with this? I've been trying for some time
Video
thank you very much in advance