i need one function that remove creatures from certain area
i try that but dosent work
someone can help me?
i try that but dosent work
someone can help me?
PHP:
function removeRaid(fromPos, toPos)
local pos = fromPos
for x=0,getDistanceBetween(fromPos, {x = toPos.x,y = fromPos.y,z=fromPos.z}) do
for y=0,getDistanceBetween(fromPos, {x = fromPos.x,y = toPos.y,z=fromPos.z}) do
pos = {x=fromPos.x+x,y=fromPos.y+y,z=fromPos.z}
end
end
for _, pid in ipairs(getTopCreature(pos)) do
if isInRange(getCreaturePosition(pid), fromPos, toPos) then
doRemoveCreature(pid)
end
end
end