• 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!

Blessed steak, Rotworm stew

Mr Zool

New Member
Joined
Jul 5, 2012
Messages
216
Reaction score
2
I need script like Rl tibia for :

Blessed steak, id 9999
Rotworm stew id 9992


Blessed steak - After use player have full Mana, can be used 1 time in 10min.
Rotworm stew - After use player have full Health, can be used 1 time in 10min.


Please and thanks.
 
Here you go, i havent tested it so post if you have any errors:

Inside actions.xml post this line:
Code:
<action itemid="9992" event="script" value="hpmana.lua"/>
<action itemid="9999" event="script" value="hpmana.lua"/>

Now create new lua and name it hpmana.lua and poste the code below:

Code:
local config = {
    storage = 10000, --use empty storage
    exhaust = 600 --Exhaust is in seconds 600 equals 10min
}

function onUse(cid, item, fromPos, itemEx, toPos)
    if (getPlayerStorageValue(cid, config.storage) <= os.time()) then
        if (item.itemid == 9992) then
            doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
            doCreatureSay(cid, "FULL HEALTH!",TALKTYPE_ORANGE_1)
            setPlayerStorageValue(cid, config.storage, os.time() + config.exhaust)
        elseif (item.itemid == 9999) then
            doPlayerAddMana(cid, getPlayerMaxMana(cid))
            doCreatureSay(cid, "FULL MANA!",TALKTYPE_ORANGE_1)
            setPlayerStorageValue(cid, config.storage, os.time() + config.exhaust)
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be used once every "..config.exhaust.." seconds. Remaining exhaustion: ".. getPlayerStorageValue(cid, config.storage) - os.time())
    end
    return true
end

Enjoy!
 
Back
Top