• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Action Script] How do I remove monsters without removing players?

Cadyan

Well-Known Member
Joined
Mar 30, 2008
Messages
844
Reaction score
63
Fixed
I am using Mystic Spirit version 0.2.5 (client 9.8)

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	area1a = {x=1577, y=1321, z=4}
	area1b = {x=1580, y=1324, z=4}
	local monsters1 = {}
	for x = area1a.x, area1b.x do
		for y = area1a.y, area1b.y do
			for z = area1a.z, area1b.z do
				if(isCreature(getTopCreature({x = x, y = y, z = z}).uid)) then
					table.insert(monsters1, getTopCreature({x = x, y = y, z = z}).uid)
				end
			end
		end
	end

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

Bleh, I tried changing it to "if isMonster" and it worked (even though I do not see the function on the server list). I'll leave up it here for other people.
 
Last edited:
Back
Top