Oi, eu queria saber como faço para que quando o player deslogar não deletar os tiles que estão embaixo dele se ele estiver de fly.
function onLogout(cid) if getCreatureStorage(cid, FLY_STORAGE) > 0 then local pos = getCreaturePosition(cid) pos.stackpos = 0 for _, area in ipairs(getArea(pos, RANGEX, RANGEY)) do doCreateTile(area) local thing = getThingFromPos(area) if thing.itemid == ITEM_FLYTILE then doRemoveItem(thing.uid) elseif thing.itemid == ITEM_WATERTILE then doTransformItem(thing.uid, WATER[1]) end end doCreatureSetStorage(cid, storPos.x, pos.x) doCreatureSetStorage(cid, storPos.y, pos.y) doCreatureSetStorage(cid, storPos.z, pos.z) end return true end
eu ja adicionei a função isWalkable
function isWalkable(pos, creature, proj, pz) if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end
só que não sei como usar ela, se alguém puder me ajudar estarei dando +rep como agradecimento.