• 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+ Is it possible to trigger the healing group with onUse function?

Solution
You can just apply the condition CONDITION_SPELLGROUPCOOLDOWN, with SPELLGROUP_HEALING as subId to a player.

I also added a small option of resetting the timer for consecutive uses, otherwise just set resetTimer to false.
Lua:
--reset the condition?
--if true, it will remove and re-add the condition
--if false, it will do nothing if the condition exists
local resetTimer = true

local cooldownHealingGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
cooldownHealingGroup:setParameter(CONDITION_PARAM_SUBID, SPELLGROUP_HEALING)
cooldownHealingGroup:setParameter(CONDITION_PARAM_TICKS, 3000) --duration in ms

local action = Action()
function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not...
You can just apply the condition CONDITION_SPELLGROUPCOOLDOWN, with SPELLGROUP_HEALING as subId to a player.

I also added a small option of resetting the timer for consecutive uses, otherwise just set resetTimer to false.
Lua:
--reset the condition?
--if true, it will remove and re-add the condition
--if false, it will do nothing if the condition exists
local resetTimer = true

local cooldownHealingGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
cooldownHealingGroup:setParameter(CONDITION_PARAM_SUBID, SPELLGROUP_HEALING)
cooldownHealingGroup:setParameter(CONDITION_PARAM_TICKS, 3000) --duration in ms

local action = Action()
function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not player:hasCondition(CONDITION_SPELLGROUPCOOLDOWN, SPELLGROUP_HEALING) then
        player:addCondition(cooldownHealingGroup)
        return true
    end
 
    if resetTimer then
        player:removeCondition(CONDITION_SPELLGROUPCOOLDOWN, SPELLGROUP_HEALING)
        player:addCondition(cooldownHealingGroup)
    end
    return true
end
action:id(2550)
action:register()
 
Last edited:
Solution
You can just apply the condition CONDITION_SPELLGROUPCOOLDOWN, with the healing group to the player

Yeah thanks to my lazyness I didn't test it lmao

used this befor:
Lua:
local cooldown = Condition(CONDITION_SPELLCOOLDOWN)
cooldown:setParameter(CONDITION_PARAM_TICKS, 500)
cooldown:setParameter(CONDITION_PARAM_SUBID, 3)
 
Back
Top