Shadow Dan
Sh4dowDan
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.
actions/scripts/staminaDoll.lua
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
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" />
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
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: