Untitled
unknown
lua
a year ago
1.2 kB
6
Indexable
function getTileCreatures(position) local creatures, found = {}, {} for stackpos = 255, 0, -1 do position.stackpos = stackpos local thing = getTileThingByPos(position) if thing.itemid ~= 0 and isCreature(thing.uid) then if not found[thing.uid] then creatures[#thing + 1] = thing.uid found[thing.uid] = 1 end end end return creatures end function hasTileProperty(position, property) position = Position(position.x, position.y, position.z) property = tonumber(property) if not property then return false end for stackpos = 1, 255 do position.stackpos = stackpos local tile = getTileThingByPos(position) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasItemProperty(tile.uid, property) then return true end end end return false end function isTileCombatAvailable(position) if getTileThingByPos({x = position.x, y = position.y, z = position.z, stackpos = 0}).itemid == 0 then return false end if getTileInfo(position).protection or getTileInfo(position).optional then return false end if hasTileProperty(position, 2) then return false end return true end
Editor is loading...
Leave a Comment