BR

Item Que Deixe A Stamina Full

Por bruno333, 06 de mai. de 2011 em Archived

2
1.1k
bruno333B
06 de maio de 2011 às 16:06

galera preciso de uma action que quando o player de use em um tal item a stamina dele volte para 42 hrs

 

vlw

JohnmlkzikaJ
06 de maio de 2011 às 21:14

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

Editado Maio 6 por Johnmlkzika