Hard to explain.
But you will understand when look code.
local besttile = getarearunetile(false, unpack(monsters))
if iscreatureontile(besttile.tile) then
besttile.tile.posx = besttile.tile.posx + 1 -- problem is here
end
Hard to explain.
But you will understand when look code.
local besttile = getarearunetile(false, unpack(monsters))
if iscreatureontile(besttile.tile) then
besttile.tile.posx = besttile.tile.posx + 1 -- problem is here
end
I SOLVED IT.
Maybe someone will need it in future
local besttile = getarearunetile(true, unpack(monsters))
if iscreatureontile(besttile.tile) then
local sqm = {tile,x,y,z,amount=0}
sqm.tile,sqm.x,sqm.y,sqm.z,sqm.amount = ground(besttile.x + 1,besttile.y,$posz),besttile.x + 1,besttile.y,$posz,besttile.amount
besttile = sqm
end