• 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!

Lua Removing monsters from area...

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
I have this lua but I can't understand why it just works once on one script... I add this to anothers scripts (talkactions/creaturescripts/globalevents) and doesn't work... Actually it works on a raid script... Any ideas?

LUA:
local from = {x = 16, y = 12, z = 5}
		local to = {x = 95, y = 81, z = 5}
		local monsters = {}
		for x = from.x, to.x do
			for y = from.y, to.y do
				local v = getTopCreature({x = x, y = y, z = 5}).uid
				if isPlayer(v) then
					return true
				elseif isMonster(v) then
					table.insert(monsters, v)
				end
			end
		end
		for i = 1, #monsters do
			doRemoveCreature(monsters[i])
		end

I need a function maybe to be added on lib and then could be used on every single script...
 
Last edited:
Back
Top