• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua -=[TFS]=- 0.4 8.60 [TALKACTION] ERROR ON SCRIPT VIP SYSTEM

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
CONSOLE GUI:

Lua:
[13/08/2023 15:39:57] [Error - TalkAction Interface]
[13/08/2023 15:39:57] In a timer event called from:
[13/08/2023 15:39:57] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 15:39:57] Description:
[13/08/2023 15:39:57] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 15:39:57] stack traceback:
[13/08/2023 15:39:58]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 15:39:58]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

Reset Script Talk:

Lua:
function onSay(cid, words, param)
 
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
 
needPa = true, -- Precisa de Premium Account? [true / false]
needPz = true, -- Precisa estar em Protection Zone? [true / false]
battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false]
red = false, -- Players PK Red pode Resetar? [true / false]
tp = false, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = true, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 54676, -- Storage [valor]
 
 
--[Configurações do Reset]__
 
resetStatus = {
 
player = getPlayerGUID(cid), -- Não Mude.
lvl = 717217, -- Level Necessário para Resetar. [valor]
lvlreset = 1, -- Level que retornará após o Reset. [valor]
limite = 99, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
tempo = 0
},
}
 
--[Funções]__
 
function Reseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function noAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function setClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function look(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function teleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function getResets(cid)
resets = getPlayerStorageValue(cid,config.storage)
 
if resets < 0 then
resets = 0
end
return resets
 
end
 
 
local resets = getResets(cid)
local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."
 
 
--[Condiçoes]__

local storageKey = 13545

if getCreatureStorage(cid, storageKey) < os.time() then
doPlayerPopupFYI(cid, "Somente Player VIP Account.")
return true
 
elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
return TRUE
 
elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
return TRUE
 
elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
return TRUE
 
elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
return TRUE
 
elseif(config.needPa == true) and not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
return TRUE
 
elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
return TRUE
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
 
elseif doPlayerSendCancel(cid, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
 
if doPlayerPopupFYI(cid, msg) then
 
end
return TRUE
 
end
 
--[By: Linnux]__
 
Last edited:
try this
Lua:
function onSay(cid, words, param)
 
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
 
needPa = true, -- Precisa de Premium Account? [true / false]
needPz = true, -- Precisa estar em Protection Zone? [true / false]
battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false]
red = false, -- Players PK Red pode Resetar? [true / false]
tp = false, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = true, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 54676, -- Storage [valor]
 
 
--[Configurações do Reset]__
 
resetStatus = {
 
player = getPlayerGUID(cid), -- Não Mude.
lvl = 717217, -- Level Necessário para Resetar. [valor]
lvlreset = 1, -- Level que retornará após o Reset. [valor]
limite = 99, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
tempo = 0
},
}
 
--[Funções]__
 
function Reseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function noAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function setClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function look(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function teleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function getResets(cid)
  return tonumber(getPlayerStorageValue(cid,config.storage)) <= 0 and 0 or tonumber(getPlayerStorageValue(cid,config.storage))
end
 
 
local resets = getResets(cid)
local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."
 
 
--[Condiçoes]__

local storageKey = 13545

if getCreatureStorage(cid, storageKey) < os.time() then
doPlayerPopupFYI(cid, "Somente Player VIP Account.")
return true
 
elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
return TRUE
 
elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
return TRUE
 
elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
return TRUE
 
elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
return TRUE
 
elseif(config.needPa == true) and not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
return TRUE
 
elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
return TRUE
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
 
elseif doPlayerSendCancel(cid, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
 
if doPlayerPopupFYI(cid, msg) then
 
end
return TRUE
 
end
 
--[By: Linnux]__
 
@Paulix

Lua:
[13/08/2023 21:24:06] [Error - TalkAction Interface]
[13/08/2023 21:24:06] In a timer event called from:
[13/08/2023 21:24:06] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:24:06] Description:
[13/08/2023 21:24:06] (luaGetCreatureStorage) Creature not found

[13/08/2023 21:24:06] [Error - TalkAction Interface]
[13/08/2023 21:24:06] In a timer event called from:
[13/08/2023 21:24:06] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:24:06] Description:
[13/08/2023 21:24:06] data/talkactions/scripts/reset.lua:115: attempt to compare nil with number
[13/08/2023 21:24:06] stack traceback:
[13/08/2023 21:24:06]     data/talkactions/scripts/reset.lua:115: in function 'getResets'
[13/08/2023 21:24:06]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 21:24:06] [Error - TalkAction Interface]
[13/08/2023 21:24:06] In a timer event called from:
[13/08/2023 21:24:06] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:24:06] Description:
[13/08/2023 21:24:06] (luaGetCreatureStorage) Creature not found

[13/08/2023 21:24:06] [Error - TalkAction Interface]
[13/08/2023 21:24:06] In a timer event called from:
[13/08/2023 21:24:06] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:24:06] Description:
[13/08/2023 21:24:06] data/talkactions/scripts/reset.lua:115: attempt to compare nil with number
[13/08/2023 21:24:06] stack traceback:
[13/08/2023 21:24:06]     data/talkactions/scripts/reset.lua:115: in function 'getResets'
[13/08/2023 21:24:06]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>
[13/08/2023 21:24:09] [VIP] Samuel Dois has logged in.
[13/08/2023 21:24:13] > Broadcasted message: "[Mistery] Explore as cidades pra ver seus misterios que nelas rodeiam.
 
try this and check whats printing on console when you calling for cid

Lua:
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
  needPa = true, -- Precisa de Premium Account? [true / false]
  needPz = true, -- Precisa estar em Protection Zone? [true / false]
  battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
  withe = false, -- Players PK Withe pode Resetar? [true / false]
  red = false, -- Players PK Red pode Resetar? [true / false]
  tp = false, -- Teleportar para o Templo após o reset? [true / false]
  look = true, -- Mostrar Resets no Look do Player? [true / false]
  addLimite = true, -- Abilitar Limite de Resets? [true / false]
  setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
  storage = 54676, -- Storage [valor]
  vipstorage = 13545,

  --[Configurações do Reset]__
  resetStatus = {
    player = getPlayerGUID(cid), -- Não Mude.
    lvl = 717217, -- Level Necessário para Resetar. [valor]
    lvlreset = 1, -- Level que retornará após o Reset. [valor]
    limite = 99, -- Máximo de resets que um player pode chegar. [valor]
    newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
    tempo = 0
  },
}

local function Reseting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end

local function noAll(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end

local function noTeleporting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end
  
local function noLook(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end
  
local function noClasse(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function setClasse(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function look(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function teleporting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function getResets(cid)
  print("cid: "..cid)
  return tonumber(getCreatureStorage(cid,config.storage)) <= 0 and 0 or tonumber(getCreatureStorage(cid,config.storage))
end

function onSay(cid, words, param)

  local resets = getResets(cid)
  local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
  local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."

  if getCreatureStorage(cid, config.vipstorage) < os.time() then
    doPlayerPopupFYI(cid, "Somente Player VIP Account.")
    return true
  elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
    doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
    return true
  elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
    doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
    return true
  elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
    doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
    return true
  elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
    doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
    return true
  elseif(config.needPa == true) and not isPremium(cid) then
    doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
    return true
  elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
    return true
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
    addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
    addEvent(noAll, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
    addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
    addEvent(noLook, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
    addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
    addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
    addEvent(look, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
    addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
  elseif doPlayerSendCancel(cid, needLvl) then
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return true
  end

  return true
end

--[By: Linnux]__
 
Lua:
[13/08/2023 21:41:36] [Error - TalkAction Interface]
[13/08/2023 21:41:36] In a timer event called from:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:41:36] Description:
[13/08/2023 21:41:36] (luaGetCreatureStorage) Creature not found

[13/08/2023 21:41:36] [Error - TalkAction Interface]
[13/08/2023 21:41:36] In a timer event called from:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:41:36] Description:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:115: attempt to compare nil with number
[13/08/2023 21:41:36] stack traceback:
[13/08/2023 21:41:36]     data/talkactions/scripts/reset.lua:115: in function 'getResets'
[13/08/2023 21:41:36]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 21:41:36] [Error - TalkAction Interface]
[13/08/2023 21:41:36] In a timer event called from:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:41:36] Description:
[13/08/2023 21:41:36] (luaGetCreatureStorage) Creature not found

[13/08/2023 21:41:36] [Error - TalkAction Interface]
[13/08/2023 21:41:36] In a timer event called from:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:41:36] Description:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:115: attempt to compare nil with number
[13/08/2023 21:41:36] stack traceback:
[13/08/2023 21:41:36]     data/talkactions/scripts/reset.lua:115: in function 'getResets'
[13/08/2023 21:41:36]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 21:41:36] [Error - TalkAction Interface]
[13/08/2023 21:41:36] In a timer event called from:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:41:36] Description:
[13/08/2023 21:41:36] (luaGetCreatureStorage) Creature not found

[13/08/2023 21:41:36] [Error - TalkAction Interface]
[13/08/2023 21:41:36] In a timer event called from:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 21:41:36] Description:
[13/08/2023 21:41:36] data/talkactions/scripts/reset.lua:115: attempt to compare nil with number
[13/08/2023 21:41:37] stack traceback:
[13/08/2023 21:41:37]     data/talkactions/scripts/reset.lua:115: in function 'getResets'
[13/08/2023 21:41:37]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>
 
try this

Lua:
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
  needPa = true, -- Precisa de Premium Account? [true / false]
  needPz = true, -- Precisa estar em Protection Zone? [true / false]
  battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
  withe = false, -- Players PK Withe pode Resetar? [true / false]
  red = false, -- Players PK Red pode Resetar? [true / false]
  tp = false, -- Teleportar para o Templo após o reset? [true / false]
  look = true, -- Mostrar Resets no Look do Player? [true / false]
  addLimite = true, -- Abilitar Limite de Resets? [true / false]
  setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
  storage = 54676, -- Storage [valor]
  vipstorage = 13545,

  --[Configurações do Reset]__
  resetStatus = {
    player = getPlayerGUID(cid), -- Não Mude.
    lvl = 717217, -- Level Necessário para Resetar. [valor]
    lvlreset = 1, -- Level que retornará após o Reset. [valor]
    limite = 99, -- Máximo de resets que um player pode chegar. [valor]
    newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
    tempo = 1 -- tempo em segundos
  }
}

local function Reseting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end

local function noAll(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end

local function noTeleporting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end
  
local function noLook(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end
  
local function noClasse(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function setClasse(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function look(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function teleporting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function getResets(cid)
  print("cid: "..cid)
  return tonumber(getCreatureStorage(cid,config.storage)) <= 0 and 0 or tonumber(getCreatureStorage(cid,config.storage))
end

function onSay(cid, words, param)
  print("cid: "..cid)

  local resets = getResets(cid)
  local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
  local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."

  if getCreatureStorage(cid, config.vipstorage) < os.time() then
    doPlayerPopupFYI(cid, "Somente Player VIP Account.")
    return true
  elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
    doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
    return true
  elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
    doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
    return true
  elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
    doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
    return true
  elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
    doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
    return true
  elseif(config.needPa == true) and not isPremium(cid) then
    doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
    return true
  elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
    return true
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
    addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
    addEvent(noAll, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
    addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
    addEvent(noLook, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
    addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
    addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
    addEvent(look, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
    addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
  elseif doPlayerSendCancel(cid, needLvl) then
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return true
  end

  return true
end

--[By: Linnux]__
 
Lua:
[13/08/2023 22:18:32] [Error - TalkAction Interface]
[13/08/2023 22:18:32] In a timer event called from:
[13/08/2023 22:18:32] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:32] Description:
[13/08/2023 22:18:32] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:32] stack traceback:
[13/08/2023 22:18:33]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:33] [Error - TalkAction Interface]
[13/08/2023 22:18:33] In a timer event called from:
[13/08/2023 22:18:33] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:33] Description:
[13/08/2023 22:18:33] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:33] stack traceback:
[13/08/2023 22:18:33]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:33] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] ADM has logged out.
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:34] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641
[13/08/2023 22:18:35] cid: 268482641

[13/08/2023 22:18:36] [Error - TalkAction Interface]
[13/08/2023 22:18:36] In a timer event called from:
[13/08/2023 22:18:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:36] Description:
[13/08/2023 22:18:36] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:36] stack traceback:
[13/08/2023 22:18:36]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:36] [Error - TalkAction Interface]
[13/08/2023 22:18:36] In a timer event called from:
[13/08/2023 22:18:36] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:36] Description:
[13/08/2023 22:18:36] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:36] stack traceback:
[13/08/2023 22:18:36]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:37] [Error - TalkAction Interface]
[13/08/2023 22:18:37] In a timer event called from:
[13/08/2023 22:18:37] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:37] Description:
[13/08/2023 22:18:37] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:37] stack traceback:
[13/08/2023 22:18:37]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:37] [Error - TalkAction Interface]
[13/08/2023 22:18:37] In a timer event called from:
[13/08/2023 22:18:37] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:37] Description:
[13/08/2023 22:18:37] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:38] stack traceback:
[13/08/2023 22:18:38]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:38] [Error - TalkAction Interface]
[13/08/2023 22:18:38] In a timer event called from:
[13/08/2023 22:18:38] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:38] Description:
[13/08/2023 22:18:38] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:38] stack traceback:
[13/08/2023 22:18:38]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:38] [Error - TalkAction Interface]
[13/08/2023 22:18:38] In a timer event called from:
[13/08/2023 22:18:38] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:39] Description:
[13/08/2023 22:18:39] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:39] stack traceback:
[13/08/2023 22:18:39]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:39] [Error - TalkAction Interface]
[13/08/2023 22:18:39] In a timer event called from:
[13/08/2023 22:18:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:39] Description:
[13/08/2023 22:18:39] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:39] stack traceback:
[13/08/2023 22:18:39]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:39] [Error - TalkAction Interface]
[13/08/2023 22:18:39] In a timer event called from:
[13/08/2023 22:18:40] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:40] Description:
[13/08/2023 22:18:40] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:40] stack traceback:
[13/08/2023 22:18:40]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:40] [Error - TalkAction Interface]
[13/08/2023 22:18:40] In a timer event called from:
[13/08/2023 22:18:40] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:40] Description:
[13/08/2023 22:18:40] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:40] stack traceback:
[13/08/2023 22:18:40]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:41] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:42] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641
[13/08/2023 22:18:43] cid: 268482641

[13/08/2023 22:18:43] [Error - TalkAction Interface]
[13/08/2023 22:18:43] In a timer event called from:
[13/08/2023 22:18:43] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:43] Description:
[13/08/2023 22:18:43] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:44] stack traceback:
[13/08/2023 22:18:44]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:44] [Error - TalkAction Interface]
[13/08/2023 22:18:44] In a timer event called from:
[13/08/2023 22:18:44] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:44] Description:
[13/08/2023 22:18:44] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:44] stack traceback:
[13/08/2023 22:18:44]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:44] [Error - TalkAction Interface]
[13/08/2023 22:18:44] In a timer event called from:
[13/08/2023 22:18:45] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:45] Description:
[13/08/2023 22:18:45] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:45] stack traceback:
[13/08/2023 22:18:45]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:45] [Error - TalkAction Interface]
[13/08/2023 22:18:45] In a timer event called from:
[13/08/2023 22:18:45] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:45] Description:
[13/08/2023 22:18:45] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:45] stack traceback:
[13/08/2023 22:18:45]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:46] [Error - TalkAction Interface]
[13/08/2023 22:18:46] In a timer event called from:
[13/08/2023 22:18:46] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:46] Description:
[13/08/2023 22:18:46] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:46] stack traceback:
[13/08/2023 22:18:46]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:46] [Error - TalkAction Interface]
[13/08/2023 22:18:46] In a timer event called from:
[13/08/2023 22:18:46] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:46] Description:
[13/08/2023 22:18:46] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:46] stack traceback:
[13/08/2023 22:18:47]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:47] [Error - TalkAction Interface]
[13/08/2023 22:18:47] In a timer event called from:
[13/08/2023 22:18:47] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:47] Description:
[13/08/2023 22:18:47] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:47] stack traceback:
[13/08/2023 22:18:47]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:47] [Error - TalkAction Interface]
[13/08/2023 22:18:47] In a timer event called from:
[13/08/2023 22:18:47] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:47] Description:
[13/08/2023 22:18:48] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:48] stack traceback:
[13/08/2023 22:18:48]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>

[13/08/2023 22:18:48] [Error - TalkAction Interface]
[13/08/2023 22:18:48] In a timer event called from:
[13/08/2023 22:18:48] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:18:48] Description:
[13/08/2023 22:18:48] data/talkactions/scripts/reset.lua:89: attempt to call global 'getResets' (a nil value)
[13/08/2023 22:18:48] stack traceback:
[13/08/2023 22:18:48]     data/talkactions/scripts/reset.lua:89: in function <data/talkactions/scripts/reset.lua:88>
 
i think you might need more time to the script fully execute
try changing "tempo" from 1 to 5

Lua:
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
  needPa = true, -- Precisa de Premium Account? [true / false]
  needPz = true, -- Precisa estar em Protection Zone? [true / false]
  battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
  withe = false, -- Players PK Withe pode Resetar? [true / false]
  red = false, -- Players PK Red pode Resetar? [true / false]
  tp = false, -- Teleportar para o Templo após o reset? [true / false]
  look = true, -- Mostrar Resets no Look do Player? [true / false]
  addLimite = true, -- Abilitar Limite de Resets? [true / false]
  setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
  storage = 54676, -- Storage [valor]
  vipstorage = 13545,

  --[Configurações do Reset]__
  resetStatus = {
    player = getPlayerGUID(cid), -- Não Mude.
    lvl = 717217, -- Level Necessário para Resetar. [valor]
    lvlreset = 1, -- Level que retornará após o Reset. [valor]
    limite = 99, -- Máximo de resets que um player pode chegar. [valor]
    newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
    tempo = 5 -- tempo em segundos
  }
}

local function Reseting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end

local function noAll(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end

local function noTeleporting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end
  
local function noLook(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  return TRUE
end
  
local function noClasse(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function setClasse(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doPlayerSetVocation(cid, config.resetStatus.newClasse)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function look(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function teleporting(cid)
  resets = getResets(cid)
  setPlayerStorageValue(cid,config.storage,resets+1)
  doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
  db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
  return TRUE
end
  
local function getResets(cid)
  return tonumber(getCreatureStorage(cid,config.storage)) <= 0 and 0 or tonumber(getCreatureStorage(cid,config.storage))
end

function onSay(cid, words, param)

  local resets = getResets(cid)
  local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
  local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."

  if getCreatureStorage(cid, config.vipstorage) < os.time() then
    doPlayerPopupFYI(cid, "Somente Player VIP Account.")
    return true
  elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
    doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
    return true
  elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
    doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
    return true
  elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
    doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
    return true
  elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
    doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
    return true
  elseif(config.needPa == true) and not isPremium(cid) then
    doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
    return true
  elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
    return true
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
    addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
    addEvent(noAll, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
    addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
    addEvent(noLook, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
    addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
    addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
    addEvent(look, config.resetStatus.tempo* 1000, cid)
  elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
    addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
  elseif doPlayerSendCancel(cid, needLvl) then
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return true
  end

  return true
end

--[By: Linnux]__
 
@Paulix
Lua:
[13/08/2023 22:52:59] [VIP] Samuel Dois has logged out.

[13/08/2023 22:52:59] [Error - TalkAction Interface]
[13/08/2023 22:52:59] In a timer event called from:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:52:59] Description:
[13/08/2023 22:52:59] (luaGetCreatureStorage) Creature not found

[13/08/2023 22:52:59] [Error - TalkAction Interface]
[13/08/2023 22:52:59] In a timer event called from:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:52:59] Description:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 22:52:59] stack traceback:
[13/08/2023 22:52:59]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 22:52:59]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 22:52:59] [Error - TalkAction Interface]
[13/08/2023 22:52:59] In a timer event called from:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:52:59] Description:
[13/08/2023 22:52:59] (luaGetCreatureStorage) Creature not found

[13/08/2023 22:52:59] [Error - TalkAction Interface]
[13/08/2023 22:52:59] In a timer event called from:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:52:59] Description:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 22:52:59] stack traceback:
[13/08/2023 22:52:59]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 22:52:59]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 22:52:59] [Error - TalkAction Interface]
[13/08/2023 22:52:59] In a timer event called from:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:52:59] Description:
[13/08/2023 22:52:59] (luaGetCreatureStorage) Creature not found

[13/08/2023 22:52:59] [Error - TalkAction Interface]
[13/08/2023 22:52:59] In a timer event called from:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:52:59] Description:
[13/08/2023 22:52:59] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 22:52:59] stack traceback:
[13/08/2023 22:52:59]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 22:52:59]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>
[13/08/2023 22:53:00] [VIP] Samuel Dois has logged in.
[13/08/2023 22:53:07] > Broadcasted message: "Por que ao inves de ficar trocando de servidor, voce nao nos ajuda e evoluir? duvidas, sugestoes, problemas ou bugs? entra em contato com o suporte em nosso website e obtenha sua solucao em no maximo 12 horas! Baiak Server nova era, um dos servidores mais serio do Brasil!".
[13/08/2023 22:53:46] [VIP] Amped has logged out.
[13/08/2023 22:53:53] [VIP] Samuel Dois has logged out.

[13/08/2023 22:53:53] [Error - TalkAction Interface]
[13/08/2023 22:53:53] In a timer event called from:
[13/08/2023 22:53:53] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:53:53] Description:
[13/08/2023 22:53:53] (luaGetCreatureStorage) Creature not found

[13/08/2023 22:53:53] [Error - TalkAction Interface]
[13/08/2023 22:53:53] In a timer event called from:
[13/08/2023 22:53:53] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:53:53] Description:
[13/08/2023 22:53:53] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 22:53:54] stack traceback:
[13/08/2023 22:53:54]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 22:53:54]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 22:53:54] [Error - TalkAction Interface]
[13/08/2023 22:53:54] In a timer event called from:
[13/08/2023 22:53:54] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:53:54] Description:
[13/08/2023 22:53:54] (luaGetCreatureStorage) Creature not found

[13/08/2023 22:53:54] [Error - TalkAction Interface]
[13/08/2023 22:53:54] In a timer event called from:
[13/08/2023 22:53:54] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:53:54] Description:
[13/08/2023 22:53:54] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 22:53:54] stack traceback:
[13/08/2023 22:53:54]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 22:53:54]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 22:53:54] [Error - TalkAction Interface]
[13/08/2023 22:53:54] In a timer event called from:
[13/08/2023 22:53:54] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:53:54] Description:
[13/08/2023 22:53:54] (luaGetCreatureStorage) Creature not found

[13/08/2023 22:53:54] [Error - TalkAction Interface]
[13/08/2023 22:53:54] In a timer event called from:
[13/08/2023 22:53:54] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 22:53:54] Description:
[13/08/2023 22:53:54] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 22:53:54] stack traceback:
[13/08/2023 22:53:54]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 22:53:54]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>
[13/08/2023 22:53:54] [VIP] Samuel Dois has logged in.
 
the problem is that the creature is logging off before the addevent executes, once the addevents runs if the player is logged out it will not be able to find the creature

did you change anything on the original script?
are you loggin instantly after using this talkaction or it takes 5 seconds to logoff?

try this code...
Lua:
function onSay(cid, words, param)
 
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
 
needPa = true, -- Precisa de Premium Account? [true / false]
needPz = true, -- Precisa estar em Protection Zone? [true / false]
battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false]
red = false, -- Players PK Red pode Resetar? [true / false]
tp = false, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = true, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 54676, -- Storage [valor]
 
 
--[Configurações do Reset]__
 
resetStatus = {
 
player = getPlayerGUID(cid), -- Não Mude.
lvl = 717217, -- Level Necessário para Resetar. [valor]
lvlreset = 1, -- Level que retornará após o Reset. [valor]
limite = 99, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
tempo = 5
},
}
 
--[Funções]__
 
function Reseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function noAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end
 
function noClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function setClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function look(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function teleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end
 
function getResets(cid)
resets = getPlayerStorageValue(cid,config.storage)
 
if resets < 0 then
resets = 0
end
return resets
 
end
 
 
local resets = getResets(cid)
local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."
 
 
--[Condiçoes]__

local storageKey = 13545

if getCreatureStorage(cid, storageKey) < os.time() then
doPlayerPopupFYI(cid, "Somente Player VIP Account.")
return true
 
elseif(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
return TRUE
 
elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
return TRUE
 
elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
return TRUE
 
elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
return TRUE
 
elseif(config.needPa == true) and not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
return TRUE
 
elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
return TRUE
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)
 
elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)
 
elseif doPlayerSendCancel(cid, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
 
if doPlayerPopupFYI(cid, msg) then
 
end
return TRUE
 
end
 
--[By: Linnux]__
 
tempo = 0

Lua:
[13/08/2023 23:44:40] [Error - TalkAction Interface]
[13/08/2023 23:44:40] In a timer event called from:
[13/08/2023 23:44:40] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:44:40] Description:
[13/08/2023 23:44:40] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 23:44:40] stack traceback:
[13/08/2023 23:44:40]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 23:44:40]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>
[13/08/2023 23:44:45] [VIP] Grassa has logged in.
[13/08/2023 23:44:48] > Broadcasted message: "[Mistery] Explore as cidades pra ver seus misterios que nelas rodeiam.

[13/08/2023 23:44:48] Bom Jogo".
[13/08/2023 23:44:56] [Warning - Monster::Monster] Unknown event name - anuncioServer
[13/08/2023 23:45:00] [Warning - Monster::Monster] Unknown event name - anuncioServer
[13/08/2023 23:45:06] [Warning - Monster::Monster] Unknown event name - anuncioServer
[13/08/2023 23:45:12] [Warning - Monster::Monster] Unknown event name - anuncioServer
[13/08/2023 23:45:39] [VIP] Grassa has logged out.

[13/08/2023 23:45:39] [Error - TalkAction Interface]
[13/08/2023 23:45:39] In a timer event called from:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:45:39] Description:
[13/08/2023 23:45:39] (luaGetCreatureStorage) Creature not found

[13/08/2023 23:45:39] [Error - TalkAction Interface]
[13/08/2023 23:45:39] In a timer event called from:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:45:39] Description:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 23:45:39] stack traceback:
[13/08/2023 23:45:39]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 23:45:39]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 23:45:39] [Error - TalkAction Interface]
[13/08/2023 23:45:39] In a timer event called from:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:45:39] Description:
[13/08/2023 23:45:39] (luaGetCreatureStorage) Creature not found

[13/08/2023 23:45:39] [Error - TalkAction Interface]
[13/08/2023 23:45:39] In a timer event called from:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:45:39] Description:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 23:45:39] stack traceback:
[13/08/2023 23:45:39]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 23:45:39]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>

[13/08/2023 23:45:39] [Error - TalkAction Interface]
[13/08/2023 23:45:39] In a timer event called from:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:45:39] Description:
[13/08/2023 23:45:39] (luaGetCreatureStorage) Creature not found

[13/08/2023 23:45:39] [Error - TalkAction Interface]
[13/08/2023 23:45:39] In a timer event called from:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:onSay
[13/08/2023 23:45:39] Description:
[13/08/2023 23:45:39] data/talkactions/scripts/reset.lua:117: attempt to compare boolean with number
[13/08/2023 23:45:39] stack traceback:
[13/08/2023 23:45:39]     data/talkactions/scripts/reset.lua:117: in function 'getResets'
[13/08/2023 23:45:39]     data/talkactions/scripts/reset.lua:96: in function <data/talkactions/scripts/reset.lua:95>
[13/08/2023 23:45:40] [VIP] Grassa has logged in.
 

Similar threads

Back
Top