roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 201
Hello, i`m using tfs 1.2
I made this script, so when the player has storage 100 of value 1, it will defend all attacks...
but the bug happens when the player uses some heal magic, it does not get heal, because the script is denying even this
i have tried somethins like this, but not work:
I made this script, so when the player has storage 100 of value 1, it will defend all attacks...
but the bug happens when the player uses some heal magic, it does not get heal, because the script is denying even this
Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
if creature:getStorageValue(100) == 1 then
creature:getPosition():sendMagicEffect(3)
return false
end
return true
end
i have tried somethins like this, but not work:
Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
if primaryType == COMBAT_HEALING then
return true
end
if creature:getStorageValue(100) == 1 then
creature:getPosition():sendMagicEffect(3)
return false
end
return true
end
Last edited: