• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua How to check queryadd in this script 1.2

gubbo123

New Member
Joined
Aug 15, 2017
Messages
151
Solutions
1
Reaction score
3
Example: this is my doors script
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
 
data/lib/core/tile.lua
Lua:
function Tile.isWalkable(self)
Lua:
if not tile:isWalkable then
    print("can't walk here")
else
    print("can walk")
end

This should be what you are looking for.
 
Back
Top