Ir para conteúdo

Featured Replies

Postado

Dei uma organizada no código,veja se ainda apresenta erro:

 

--[[
Tag:Desbugar
-- Kyyah Silva
]]--
local STORAGE_EXAUSTED = 91812
local exausted = 120        --Minutos.

function onSay(cid, words)
    local storage = getPlayerStorageValue(cid, STORAGE_EXAUSTED)
    local retorno = doPlayerSendCancel(cid, string.format("Aguarde %d segundo%s para usar este comando novamente.", storage - os.time(), storage - os.time() > 1 and "s" or ""))
    
    if (!retorno) then
        local time = 4    -- em segundos 1 = 1 segundo 2 = 2 segundos...

        local say_events = {}
    
        function SayText(cid)
            if isPlayer(cid) then
                if say_events[getPlayerGUID(cid)] ~= nil then
                    if isPlayer(cid) == TRUE then
                        doSendAnimatedText(getPlayerPosition(cid),"Treinando!", math.random(01,255))
                    end
                say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)
                doCreatureSetNoMove(cid, true)
                end
            end
            return true
        end
    
        function onSay(cid, words, param, channel)
            if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Utilize '".. words .. " on' para ligar e '".. words .. " off' para desligar.")
                return true
            end
    
            if param == "on" then
                if isPlayer(cid) then
                    doSendAnimatedText(getPlayerPosition(cid),"Treinando", math.random(01,255))
                end
                say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você está em modo 'Training'.")
                doPlayerSendTextMessage(cid,20,"Para sair do modo 'training' diga ".. words .. " off")

            else
                stopEvent(say_events[getPlayerGUID(cid)])
                say_events[getPlayerGUID(cid)] = nil
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você não está mais em modo 'Training'.")
                doCreatureSetNoMove(cid, false)
            end

            return true 
        end 

    else
        return true
    end
    
 return true
end

 

Editado por Rayo (veja o histórico de edições)

  • Respostas 12
  • Visualizações 759
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Quando for um script meu pode me marcar que ajudo na questão.   Tem como fazer dessa maneira:   Ou assim: -- Créditos para Yan Liima - Night criador da script. local time = 4

Posted Images

Postado

Caso não tenha conseguido, testei agora aqui e funfo normal

 

Spoiler

--[[
    Tag:Desbugar
    -- Kyyah Silva
]]--
local STORAGE_EXAUSTED = 91812
local exausted = 120        --Minutos.
function onSay(cid, words)
local storage = getPlayerStorageValue(cid, STORAGE_EXAUSTED)
    if storage > os.time() then
        return doPlayerSendCancel(cid, string.format("Aguarde %d segundo%s para usar este comando novamente.", storage - os.time(), storage - os.time() > 1 and "s" or ""))
    else
        local time = 4    -- em segundos 1 = 1 segundo 2 = 2 segundos...

    local say_events = {}
local function SayText(cid)
    if isPlayer(cid) == TRUE then
    if say_events[getPlayerGUID(cid)] ~= nil then
    if isPlayer(cid) == TRUE then
    doSendAnimatedText(getPlayerPosition(cid),"Treinando!", math.random(01,255))
    end
    say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)
    doCreatureSetNoMove(cid, true)
    end
    end
    return TRUE
end
function onSay(cid, words, param, channel)
    if(param == '') then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Utilize '".. words .. " on' para ligar e '".. words .. " off' para desligar.")
    return true
    end
    if param == "on" then
    if isPlayer(cid) == TRUE then
    doSendAnimatedText(getPlayerPosition(cid),"Treinando", math.random(01,255))
    end
    say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você está em modo 'Training'.")
    doPlayerSendTextMessage(cid,20,"Para sair do modo 'training' diga ".. words .. " off")
    elseif param == "off" then
    stopEvent(say_events[getPlayerGUID(cid)])
    say_events[getPlayerGUID(cid)] = nil
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você não está mais em modo 'Training'.")
    doCreatureSetNoMove(cid, false)
    end
    return true
end

 

Postado
  • Autor
44 minutos atrás, gagfota disse:

Caso não tenha conseguido, testei agora aqui e funfo normal

 

  Ocultar conteúdo

--[[
    Tag:Desbugar
    -- Kyyah Silva
]]--
local STORAGE_EXAUSTED = 91812
local exausted = 120        --Minutos.
function onSay(cid, words)
local storage = getPlayerStorageValue(cid, STORAGE_EXAUSTED)
    if storage > os.time() then
        return doPlayerSendCancel(cid, string.format("Aguarde %d segundo%s para usar este comando novamente.", storage - os.time(), storage - os.time() > 1 and "s" or ""))
    else
        local time = 4    -- em segundos 1 = 1 segundo 2 = 2 segundos...

    local say_events = {}
local function SayText(cid)
    if isPlayer(cid) == TRUE then
    if say_events[getPlayerGUID(cid)] ~= nil then
    if isPlayer(cid) == TRUE then
    doSendAnimatedText(getPlayerPosition(cid),"Treinando!", math.random(01,255))
    end
    say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)
    doCreatureSetNoMove(cid, true)
    end
    end
    return TRUE
end
function onSay(cid, words, param, channel)
    if(param == '') then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Utilize '".. words .. " on' para ligar e '".. words .. " off' para desligar.")
    return true
    end
    if param == "on" then
    if isPlayer(cid) == TRUE then
    doSendAnimatedText(getPlayerPosition(cid),"Treinando", math.random(01,255))
    end
    say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você está em modo 'Training'.")
    doPlayerSendTextMessage(cid,20,"Para sair do modo 'training' diga ".. words .. " off")
    elseif param == "off" then
    stopEvent(say_events[getPlayerGUID(cid)])
    say_events[getPlayerGUID(cid)] = nil
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você não está mais em modo 'Training'.")
    doCreatureSetNoMove(cid, false)
    end
    return true
end

 

 

 

Screenshot_93.png

1 hora atrás, Rayo disse:

Dei uma organizada no código,veja se ainda apresenta erro:

 


--[[
Tag:Desbugar
-- Kyyah Silva
]]--
local STORAGE_EXAUSTED = 91812
local exausted = 120        --Minutos.

function onSay(cid, words)
    local storage = getPlayerStorageValue(cid, STORAGE_EXAUSTED)
    local retorno = doPlayerSendCancel(cid, string.format("Aguarde %d segundo%s para usar este comando novamente.", storage - os.time(), storage - os.time() > 1 and "s" or ""))
    
    if (!retorno) then
        local time = 4    -- em segundos 1 = 1 segundo 2 = 2 segundos...

        local say_events = {}
    
        function SayText(cid)
            if isPlayer(cid) then
                if say_events[getPlayerGUID(cid)] ~= nil then
                    if isPlayer(cid) == TRUE then
                        doSendAnimatedText(getPlayerPosition(cid),"Treinando!", math.random(01,255))
                    end
                say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)
                doCreatureSetNoMove(cid, true)
                end
            end
            return true
        end
    
        function onSay(cid, words, param, channel)
            if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Utilize '".. words .. " on' para ligar e '".. words .. " off' para desligar.")
                return true
            end
    
            if param == "on" then
                if isPlayer(cid) then
                    doSendAnimatedText(getPlayerPosition(cid),"Treinando", math.random(01,255))
                end
                say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você está em modo 'Training'.")
                doPlayerSendTextMessage(cid,20,"Para sair do modo 'training' diga ".. words .. " off")

            else
                stopEvent(say_events[getPlayerGUID(cid)])
                say_events[getPlayerGUID(cid)] = nil
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,"Você não está mais em modo 'Training'.")
                doCreatureSetNoMove(cid, false)
            end

            return true 
        end 

    else
        return true
    end
    
 return true
end

 

 

quando tenta usar aparece 

Screenshot_94.png

Postado
5 minutos atrás, leozincorsair disse:

 

Screenshot_93.png

quando tenta usar aparece 

Screenshot_94.png

 

Certamente o seu boneco ja está com a STORAGE salva(pois deve ter tentado usar antes o script). Cria uma nova conta e testa!

Postado
  • Autor
13 minutos atrás, Rayo disse:

Certamente o seu boneco ja está com a STORAGE salva(pois deve ter tentado usar antes o script). Cria uma nova conta e testa!

 

muidei varias vezes, mais sempre aparece mesma coisa. ate com char novo

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo