Originally Posted by BadVolt
Elso you have wrong params list in function OnKill. Event EVENT_UNIT_DEATH_STATE_CHANGED have 2 args: unitTag,isDead. So, you have to work with them.
Lua Code:
function OnKill(unitTag, isDead) If unitTag==GetUnitName("player") and isDead then ... end end
If nothing works, you can check EVENT_PLAYER_DEAD param. It can have some args, so may be interested to check them.. but to info on WIKI about it.
|
In this case is wiki wrong, all events has "eventCode" as a first argument, so mikethecoder4's OnKill() function was correct.