• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ onhealth bonus

ZeroSkyer

Member
Joined
May 17, 2019
Messages
62
Reaction score
9
Location
EEUU
Hello, I've been like 3 hours and I can't do that works. I also want to know if it is safe to register the event in OnSpawn? Same as self:registerEvent('amplificationPotions')

What does not work is the attacker:getStorageValue(Storage.dromePotions.iceAmplification), the rest works fine

Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if attacker:getStorageValue(Storage.dromePotions.iceAmplification) == 1 then
        if primaryType == COMBAT_FIREDAMAGE then
            print("Primary damage type is FIRE.. amplyfing damage")
            print("Initial damage value: " .. primaryDamage)
            primaryDamage = primaryDamage / 0.92
            print("Modified damage value: " .. primaryDamage)
        end
        if secondaryType == COMBAT_FIREDAMAGE then
            print("Primary damage type is FIRE.. amplyfing damage")
            print("Initial damage value: " .. primaryDamage)
            secondaryDamage = secondaryDamage / 0.92
            print("Modified damage value: " .. primaryDamage)
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end
 
Solution
register it for players with onLogin
register it for monsters with onSpawn

Before you check for a storage value, check if attacker is a player.

Should be good to go. And safe.
register it for players with onLogin
register it for monsters with onSpawn

Before you check for a storage value, check if attacker is a player.

Should be good to go. And safe.
 
Solution
Back
Top