Example: this is my doors script
how can a check be made if there is a blocking item or creature the player will be moved to, if there is something there, the player is moved in the opposite direction
This is the actually behavior
This the expected
Lua:
door = openVerticalDoors[item:getId()]
if door then
local doorCreature = Tile(item:getPosition()):getTopCreature()
if doorCreature then
doorCreature:teleportTo(item:getPosition():moveRel(1, 0, 0), true)
end
item:transform(door, 1)
item:decay()
return true
end
how can a check be made if there is a blocking item or creature the player will be moved to, if there is something there, the player is moved in the opposite direction
This is the actually behavior
This the expected