galera preciso de uma action que quando o player de use em um tal item a stamina dele volte para 42 hrs
vlw
galera preciso de uma action que quando o player de use em um tal item a stamina dele volte para 42 hrs
vlw
Adicone no action \/
<action itemid="11387" script="stamina.lua"/>
crie uma arquivo stamina.lua
config = {StaminaFull = 42*60,
effect = 53,
text = "Your stamina is now full!",
text2 = "Your stamina is already full!",
removeOnUse = "no", -- remover quando usar ("yes" or "no")
needPremium = "yes" --[[ (yes/no) ]]
}
function onUse(cid, item, frompos, item2, topos)
if(config.needPremium == "yes") then
if (not isPremium(cid)) then
doPlayerSendCancel(cid, "You need a premium account to use this item!.")
return true
end
if getPlayerStamina(cid) ~= config.StaminaFull then
doPlayerSetStamina(cid, config.StaminaFull)
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
end
doPlayerSendTextMessage(cid,19,config.text)
doSendMagicEffect(getPlayerPosition(cid), config.effect)
else
doPlayerSendTextMessage(cid,22,config.text2)
end
end
return TRUE
end
+ Rep para min que ajudei