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

Removing fields, monsters from certain area.

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hello.

I need something that will remove all fields and all monsters from area.

Just entire code which I can paste into already made script.

I've got no ideas how to make it.

Regards,
Hermes
 
Hmm you need some tjing like this?

XXXXXXXXXXXMXXXXXXMXXXXXM
XXXMXXXXXXXXXXXXMMXXXXXXX
XXXXXXXXMXXXXXXXMXXXXXXXX

X - free tile
M - monster

And you want to delete it from area like this one? xD
 
Look, I have PvP arena, and when players are fighting, they are putting fire fields, and summoning monsters to give yourself some advantege. But when fight is finished, summons are still on arena, and there is alot of mess with fields which not dissapeared :/
 
Code:
local function doRemoveMonster(topLeft, bottomRight) -- remove monsters and items and players ;)

	checking = {x=topLeft.x, y=topLeft.y, z=topLeft.z, stackpos=topLeft.stackpos}

	playerArena = false 

	monsterArena = false  

	repeat

	creature = getThingfromPos(checking)

	if creature.itemid > 0 then

		if isCreature(creature.uid) == TRUE then

			doRemoveCreature(creature.uid)

			monsterArena = true

		else

			doRemoveItem(creature.uid)

			monsterArena = true

		end

		if isPlayer(creature.uid) == TRUE then

			fullArena = true

		end

	end

	checking.x=checking.x+1

	if checking.x>bottomRight.x then

		checking.x=topLeft.x

		checking.y=checking.y+1

	end

	until checking.y>bottomRight.y		

end

it doesnt actually remove fire fields etc, but i am sure that can be fixed, i'll take a loot at it later, but thats something you can play around with, it checks an area from a corner to another corner
 
Back
Top