• 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!

Lua Condition dont apply damage

Kaivan

New Member
Joined
Apr 29, 2021
Messages
13
Reaction score
1
Hello,

I'm trying to make the fire condition apply when playing attacking the other, but despite being applied, it's not returning damage to the player. What am I doing wrong?
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local condition = Condition(CONDITION_FIRE)
    condition:addDamage(4, 100, {1, 3})
    creature:addCondition(condition)
    return primaryDamage, primaryType, secondaryDamage, secondaryType, origin
end

TFS 1.4, dont errors in console, just the damage dont work, but the effect of the attack appears!
 
Solution
Hello,

I'm trying to make the fire condition apply when playing attacking the other, but despite being applied, it's not returning damage to the player. What am I doing wrong?
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local condition = Condition(CONDITION_FIRE)
    condition:addDamage(4, 100, {1, 3})
    creature:addCondition(condition)
    return primaryDamage, primaryType, secondaryDamage, secondaryType, origin
end

TFS 1.4, dont errors in console, just the damage dont work, but the effect of the attack appears!
TFS 1.4 condition expect parameters:
Code:
condition:addDamage(rounds, time, value)
Each parameter must be integer value (number)...
Hello,

I'm trying to make the fire condition apply when playing attacking the other, but despite being applied, it's not returning damage to the player. What am I doing wrong?
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local condition = Condition(CONDITION_FIRE)
    condition:addDamage(4, 100, {1, 3})
    creature:addCondition(condition)
    return primaryDamage, primaryType, secondaryDamage, secondaryType, origin
end

TFS 1.4, dont errors in console, just the damage dont work, but the effect of the attack appears!
TFS 1.4 condition expect parameters:
Code:
condition:addDamage(rounds, time, value)
Each parameter must be integer value (number).

Example from TFS 1.4 ( data/spells/scripts/custom/combustion.lua ):
Lua:
local condition = Condition(CONDITION_FIRE)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:addDamage(5, 3000, -25)
condition:addDamage(1, 5000, -666)
Example: 25 damage 5 times every 3 seconds and then 666 damage 1 time after 5 seconds
 
Solution
Back
Top