adrenyslopez
Member
- Joined
- Dec 22, 2015
- Messages
- 201
- Reaction score
- 15
Hello good evening, I have this script that is causing me problems in the otbr tfs 1.3 canary version
The function of the script is for the monster that when hitting them with the determined element in this case energy, heals the monster.
But it is also affecting the player's, when hitting a player with energy what it does is heal them
script.lua
The function of the script is for the monster that when hitting them with the determined element in this case energy, heals the monster.
But it is also affecting the player's, when hitting a player with energy what it does is heal them
script.lua
Lua:
local healEnergyDamage = CreatureEvent("healEnergyDamage")
function healEnergyDamage.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if primaryType == COMBAT_ENERGYDAMAGE or secondaryType == COMBAT_ENERGYDAMAGE then
primaryType = COMBAT_HEALING
primaryDamage = (primaryDamage + secondaryDamage)
secondaryType = COMBAT_NONE
secondaryDamage = 0
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
healEnergyDamage:register()