• 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 0.X Why this script don't work? help

Pniaku

New Member
Joined
Feb 3, 2019
Messages
13
Reaction score
0
Hi all, why this dont work? this dont add 100 Max hp to player :/

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
       
        doPlayerAddMaxHealth(cid, 100)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You get 100 HP Points!")
        doSendMagicEffect(getThingPos(cid), 5)
        doRemoveItem(item.uid)
       
    return true
end

Edit: How to add Player Max HP with function on Use?
 
Last edited:
Solution
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You get 100 HP Points!")
    doSendMagicEffect(getThingPos(cid), 5)
    doRemoveItem(item.uid)
    return true
end
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You get 100 HP Points!")
    doSendMagicEffect(getThingPos(cid), 5)
    doRemoveItem(item.uid)
    return true
end
 
Solution
Back
Top