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

Lua How To Make This Restore Stamina?

Alyhide

Banned User
Joined
Aug 21, 2010
Messages
1,945
Reaction score
55
Location
Switzerland
I have this script to heal health, but how would I make it give the character full Stamina?? o.0

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local health = math.random(20000, 50000)
        if(item.itemid == 8635) and getGlobalStorageValue(53435) <= os.time() then
            doCreatureAddHealth(cid, health)
            doSendMagicEffect(getCreaturePosition(cid), 12)
            doCreatureSay(cid, "Ahhh...", TALKTYPE_ORANGE_1)
            setGlobalStorageValue(53435, os.time() + 60)
            doSendAnimatedText(getPlayerPosition(cid), health, 23)
        else
            doPlayerSendCancel(cid,"You cannot use this yet.")
            doSendMagicEffect(getCreaturePosition(cid), 2)
        end
    return TRUE
end
 
There, it will add both health and stamina xDDD

LUA:
local sMinutes = 42*60-- 42h?

function onUse(cid, item, fromPosition, itemEx, toPosition)
local health = math.random(20000, 50000)
        if(item.itemid == 8635) and getGlobalStorageValue(53435) <= os.time() then
            doCreatureAddHealth(cid, health)
            doSendMagicEffect(getCreaturePosition(cid), 12)
            doCreatureSay(cid, "Ahhh...", TALKTYPE_ORANGE_1)
            setGlobalStorageValue(53435, os.time() + 60)
            doSendAnimatedText(getPlayerPosition(cid), health, 23)
			doPlayerSetStamina(cid, sMinutes)
        else
            doPlayerSendCancel(cid,"You cannot use this yet.")
            doSendMagicEffect(getCreaturePosition(cid), 2)
        end
    return TRUE
end

Without health:

LUA:
local sMinutes = 42*60-- 42h?

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if(item.itemid == 8635) and getGlobalStorageValue(53435) <= os.time() then
            doSendMagicEffect(getCreaturePosition(cid), 12)
            doCreatureSay(cid, "Ahhh...", TALKTYPE_ORANGE_1)
            setGlobalStorageValue(53435, os.time() + 60)
            doSendAnimatedText(getPlayerPosition(cid), health, 23)
			doPlayerSetStamina(cid, sMinutes)
        else
            doPlayerSendCancel(cid,"You cannot use this yet.")
            doSendMagicEffect(getCreaturePosition(cid), 2)
        end
    return TRUE
end
 
Back
Top