Siegh
Thronar Developer
I'm using TFS 1.2!
It's my first time messing around with the onEquip and onDeEquip functions for movements and I'm trying to make a simple health increase on equip function.
It works perfectly, both for equiping and unequiping, BUT for some crazy reason the onEquip health increase is tripled. It increases my health by 30 when equipping, but reduces it by 10 when unequipping.
Any clues on why is this happening?
It's my first time messing around with the onEquip and onDeEquip functions for movements and I'm trying to make a simple health increase on equip function.
It works perfectly, both for equiping and unequiping, BUT for some crazy reason the onEquip health increase is tripled. It increases my health by 30 when equipping, but reduces it by 10 when unequipping.
LUA:
function onEquip(player, item, slot)
if item.itemid == 2461 then
local maxHp = player:getMaxHealth()
player:getPosition():sendMagicEffect(1)
player:setMaxHealth(maxHp+10)
end
return true
end
function onDeEquip(player, item, slot)
if item.itemid == 2461 then
local maxHp = player:getMaxHealth()
player:getPosition():sendMagicEffect(1)
player:setMaxHealth(maxHp-10)
end
return true
end
Any clues on why is this happening?