vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, im tried make simple reflecta system, only for dmg dealed by monsters, and it working but i don't know why in console, i have erros "creature not found"? what's wrong with it?
Code:
local reflectaHealth = CreatureEvent("ReflectaHealthEvent")
function reflectaHealth.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
local amount = getPlayerReflecta(creature)
if not attacker or not attacker:isPlayer() then
doTargetCombatHealth(creature, attacker, primaryType, (primaryDamage * (amount*5)), (primaryDamage * (amount*5)))
else
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
reflectaHealth:register()