brunolopes
New Member
- Joined
- Nov 8, 2009
- Messages
- 49
- Reaction score
- 1
Hello!
I am having problems with the function onEquip, see this LUA script:
The function of the script is: When the player equips the item 2467 he got 100 maxHealth.
But in the game he got twice this value. For example: A player with 500 hp equip this item and the hp is now 700 instead of 600.
Another problem is when the player deEquip the item, instead of takes the twice too, he takes the normal -100 maxHealth.
How I can solve it?
Please Help!
I am having problems with the function onEquip, see this LUA script:
Code:
local r = {
[2467] = {
slot = CONST_SLOT_ARMOR,
}
}
function onEquip(cid, item, slot)
local k = r[item.itemid]
if(k and slot == k.slot) then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+100)
end
return true
end
function onDeEquip(cid, item, slot)
local k = r[item.itemid]
if(k and slot == k.slot) then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)-100)
end
return true
end
The function of the script is: When the player equips the item 2467 he got 100 maxHealth.
But in the game he got twice this value. For example: A player with 500 hp equip this item and the hp is now 700 instead of 600.
Another problem is when the player deEquip the item, instead of takes the twice too, he takes the normal -100 maxHealth.
How I can solve it?
Please Help!