Postado Agosto 15, 2019 5 anos 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 Agosto 15, 2019 5 anos por Rayo (veja o histórico de edições)
Postado Agosto 15, 2019 5 anos 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 Agosto 15, 2019 5 anos 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 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
Postado Agosto 15, 2019 5 anos 5 minutos atrás, leozincorsair disse: quando tenta usar aparece 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 Agosto 15, 2019 5 anos 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.