Getting tile data
To get the current world Tile data you can use the GetTiles()
function which returns a table containing them
Example script
tiles = GetTiles()
-- if tile fg is equal to 2 (Dirt) then it will print the position of that tile
for _, tile in pairs(tiles) do
if tile.fg == 2 then
log(("Found Dirt at %d, %d"):format(tile.pos.x, tile.pos.y))
end
end
Last updated