• 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 onDeath Problem

Sherice

Sky&Wind
Joined
Jan 20, 2012
Messages
183
Reaction score
7
Location
Sweden
Hello, I just want to know what's wrong with this script:

Code:
function onDeath(cid, corpse, deathList)	

	registerCreatureEvent(cid, "OnDeath2")

	if isMonster(getCreatureByName("Bandit Chief")) then
		setPlayerStorageValue(cid, 20001, 1)
	end	
return TRUE -- dont know if this is needed
end

in creaturescripts.xml I have:

Code:
	<event type="death" name="OnDeath2" event="script" value="ondeath2.lua"/>

and in the monster.xml (bandit chief in this case):

Code:
<script>
<event name="OnDeath2"/>
</script>

between flags and attacks.

So, when I kill him, I check the storage, and it doesn't change.
Could it possibly be that it doesn't work because I've two onDeath scripts?

Thanks for help, will rep!
 
Back
Top