luanmaximus123
New Member
- Joined
- Oct 28, 2010
- Messages
- 15
- Reaction score
- 2
I'm creating a spell that increases the player's damage, I'm using this script:
login.lua
The problem is that it doesn't work, I only get the print 'Test' when I heal myself or take damage.
(The spell for storage is working perfectly)
TFS 1.4.2
LUA:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if not creature or not attacker or not attacker:isPlayer() then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
if attacker:getStorageValue(3482101) == 1 then
primaryDamage = primaryDamage + (primaryDamage * 50 / 100)
secondaryType = secondaryType + (secondaryType * 50 / 100)
print("Test")
end
return primaryDamage, primaryType, primaryDamage, secondaryType
end
Code:
<event type="healthchange" name="buffdamage" script="buffDamage.lua"/>
login.lua
Code:
player:registerEvent("buffdamage")
The problem is that it doesn't work, I only get the print 'Test' when I heal myself or take damage.
(The spell for storage is working perfectly)
TFS 1.4.2