• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.2] Looking for a way to scale pots

Caduceus

Unknown Member
Joined
May 10, 2010
Messages
321
Solutions
2
Reaction score
24
I am looking for a way to scale health pots, based on maxHeath. This is what I have right now, but it is healing the player twice, with each use.

Code:
if not doTargetCombatHealth(0, target, COMBAT_HEALING, player:addHealth(player:getMaxHealth() / 12), player:addHealth(player:getMaxHealth() / 6), CONST_ME_MAGIC_BLUE) then
            return false
        end
 
Code:
        addEvent(function() player:addHealth(player:getMaxHealth() / 12) end, 1000)
        addEvent(function() player:addHealth(player:getMaxHealth() / 6) end, 1000)
        addEvent(function() player:addHealth(player:getMaxHealth() / 3) end, 1000)
        addEvent(function() player:addHealth(player:getMaxHealth() / 1.5) end, 1000)
 
I am looking for a way to scale health pots, based on maxHeath. This is what I have right now, but it is healing the player twice, with each use.

Code:
if not doTargetCombatHealth(0, target, COMBAT_HEALING, player:addHealth(player:getMaxHealth() / 12), player:addHealth(player:getMaxHealth() / 6), CONST_ME_MAGIC_BLUE) then
            return false
        end

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target:isPlayer() then
    return false
end

local MIN,MAX = target:getMaxHealth() / 12, target:getMaxHealth() / 6
if not doTargetCombatHealth(0, target.uid, COMBAT_HEALING, MIN, MAX, CONST_ME_MAGIC_BLUE) then
    return false
end

return true
end
 
Back
Top