• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Remove creature on area

MiPo91

Member
Joined
Mar 30, 2010
Messages
299
Reaction score
18
Location
Finland
Hello, could someone tell me how to make this check if the creature is summon or not, because this scripts removes all the monsters in the specific area, but if they are not found it gives alot of errors inside the console...
Code:
for x = from.x, to.x do
	for y = from.y, to.y do
		for z = from.z, to.z do
			local v = getTopCreature({x=x, y=y, z=z}).uid
			if isPlayer(v) then
				selfSay("Someone is already killing boss, please wait until he's done!", cid)
				return
			elseif isMonster(v) then
				table.insert(monsters, v)
			end
		end
	end
end

for i = 1, #monsters do
	doRemoveCreature(monsters[i])
end

the error
Code:
[20:10:04.100] [Error - NpcScript Interface]
[20:10:04.101] data/npc/scripts/killinginthenameof.lua:onCreatureSay
[20:10:04.101] Description:
[20:10:04.101] (luaDoRemoveCreature) Creature not found
 
Back
Top