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

Check area - Remove monsters.

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hi there... Well I need a script, it should check area, from one tile to another tile, if there are players, then it skip the process, but if there aren't players, then it removes al existing creatures on the area and adds a teleport.
 
Code:
local from = {x=100, y=100, z=7}
local to = {x=200, y=200, z=7}
local teleportCreate = {x=300, y=300, z=7}
local teleportTo = {x=400, y=400, z=7}

local monsters = {}

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})
			if v.type == 1 then
				return
			elseif v.type == 2 then
				table.insert(monsters, v.uid)
			end
		end
	end
end

for i = 1, #monsters do
	doRemoveCreature(monsters[i])
end
doCreateTeleport(1387, teleportTo, teleportCreate)
 
Last edited:
Back
Top