Trying to implement this script:
But it won't work, it doesn't do anything.
But if I use this one:
I seem to only get it to work when I heal a player with an UH and if I use it on myself I get an added CONST_ME_POFF.
Any ideas why this is not working/happening?
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
--if math.random(1, 1) == 1 then
if origin == ORIGIN_MELEE then
creature:getPosition():sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)
return primaryDamage * 1000, primaryType, secondaryDamage, secondaryType
end
return primaryDamage * 1000, primaryType, secondaryDamage, secondaryType
end
But if I use this one:
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
creature:getPosition():sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)
return true
end
Any ideas why this is not working/happening?