Ir para conteúdo
  • 0
LeoTK

Scripting [Suporte] Editar script stamina potion

Pergunta

LeoTK    2
LeoTK

Salve galera alguém pode me dar uma força, tentei editar de diversas formas e não consegui estou querendo fazer duas coisas nesse script caso o jogador tiver a stamina full apareça a mensagem falando que tem a stamina full e não use a poção, e após usar ter um delay de 1 hora pra usar novamente. Aparentemente já existe no script para caso estiver com a stamina cheia não gaste porém não esta funcionando alguém pode dar uma força...

Base: TFS 0.3.6, Versão: 8.54

local config = {
    tempo = 120, -- Tempo em minutos
    effect = 592,
    remove_on_use = "yes"
}
        


function onUse(cid, item, frompos, item2, topos)
local cfg = {}
    cfg.refuel = 42 * 60 * 1000
    if(getPlayerStamina(cid) >= cfg.refuel) then
        doPlayerSendCancel(cid, "Your stamina is already full.")
    doPlayerAddStamina(cid, config.tempo)
    doSendMagicEffect(getThingPos(cid), config.effect)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua stamina foi regenerada em 2 horas.")

    if config.remove_on_use == "yes" then
        doRemoveItem(item.uid, 1)
    end
    end
return true
end

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

2 respostass a esta questão

Recommended Posts

  • 2
GryLLo    19
GryLLo
"You need to wait " .. (getPlayerStorageValue(cid, config.storage) - os.time()) ..", minutes to refill your stamina again."

Se liga aqui ó:

(getPlayerStorageValue(cid, config.storage) - os.time()) -- segundos
((getPlayerStorageValue(cid, config.storage) - os.time()) / 60) -- minutos
(((getPlayerStorageValue(cid, config.storage) - os.time()) / 60) / 60) -- horas


Uns hugs :)

Compartilhar este post


Link para o post
Compartilhar em outros sites
Visitante
Este tópico está impedido de receber novos posts.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×