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

Action [TFS 1.2] Stamina doll

Shadow Dan

Sh4dowDan
Joined
Jun 5, 2010
Messages
344
Reaction score
88
Location
Poland
I made this script since i don't see any useful stamina doll.
actions/actions.xml
You can change 7377 to your item ingame, make sure this item is not used by other script in actions.xml.
Code:
<action itemid="7377" script="staminaDoll.lua" />
actions/scripts/staminaDoll.lua
Lua:
--script made by Sh4dowDan
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)

    local s = player:getStamina() / 60
    local cfg = {}
        cfg.refuel = 42
        cfg.full = 40

    if s >= cfg.full then
        player:sendCancelMessage("Your stamina is already full.")
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina now is "..s.." h.")
    else
        player:setStamina(cfg.refuel*60)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
        item:remove(1)
    end
    return true
end
editable
cfg.refuel = 42 -- item will refill stamina to 42 hours
cfg.full = 40 -- when you have 40 h or more stamina item will send cancel message
 
Last edited by a moderator:
Thaaaaaaaaank you. I was looking for this script a few days (even tried to do it without success, because I forgot the getStamina function

Thank ♥
Rep+
 
i have a problem for this scripty

[Warning - Event :: checkScript] Can not load script: scripts / staminaDoll.lua
Data / actions / scripts / staminaDoll.lua: 3: '=' expected near 'á'
 
i have a problem for this scripty

[Warning - Event :: checkScript] Can not load script: scripts / staminaDoll.lua
Data / actions / scripts / staminaDoll.lua: 3: '=' expected near 'á'

That character it says its near... doesn't exist in the released script. I would say it's most definitely a copy-paste error. Try to re-copy and paste.
 
How can I get it to fill it for only 4 hours instead?
Lua:
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local currentStamina = player:getStamina()
player:setStamina(currentStamina + 240)
return true
end
 
How can I make a SOUL DOLL? Would anyone know please?
Is there getSoul?
 
Back
Top