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

Solved How to check if a creature die in an area?

JNLP

Hail Odin!
Joined
Aug 4, 2008
Messages
54
Reaction score
0
Location
Brazil
Well, I'm trying to do a script that check if an edited monster die, then if it does, a wall would be removed. But, I want only if the edited monster of a certain area dies, remove the wall... Is there a way to do this? (I thought of using "function getCreatureInArea", but then it would check if there's a creature in the area, but won't check if the monster die in that area :blink:)

(Sorry, it was a little hard to explain)
 
Last edited:
Lua:
local monster = "rat"
local area = {	
				frompos = {x=1,y=1,z=1},   -- the first north-west tile pos
				topos = {x=1,y=1,z=1}		-- the last south-east tile pos
			}
function onKill(cid,target,lastHit)
	if isMonster(target) then			-- checks if killed thing is monster
		if isInRange(getThingPos(target) , area.frompos, area.topos) then -- check for area killed in
			if string.lower(getCreatureName(target)) == string.lower(monster) then -- check for monster name
				--- do script
			end
		end
	end
	return true
end
 
Back
Top