• 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!

TFS 0.X Script Reset System Every time I use that keyboard shortcut, the server freezes Down Hotkey ElBot NG

Sabath

New Member
Joined
Jul 20, 2026
Messages
1
Reaction score
0
auto 1 listas 'Auto Reset' | setcolor 265 255 255 | if [$inpz >= && $level >= ] say '!reset' server down

LUA:
function onSay(cid, words, param)
 
--[Configurações de Condição]__
 
config = { --[[verdadeiro / Falso]]
 
needPa = false, -- Precisa de Premium Account? [true / false]
needPz = false, -- Precisa estar em Protection Zone? [true / false]
battle = false, -- 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 = false, -- 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 = 100, -- 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]__
 
LUA:
local config = {
    storage = 54676,
    cooldownStorage = 54677,
    cooldown = 5,

    needLevel = 717217,
    resetToLevel = 1,
    maxResets = 100,

    needPz = false,
    needNoBattle = false,
    blockWhiteSkull = false,
    blockRedSkull = false,
    needPremium = false,

    teleportToTemple = false,
    changeVocation = false,
    newVocation = 1,

    needVipStorage = false,
    vipStorage = 13545
}

local function getResets(cid)
    local value = getPlayerStorageValue(cid, config.storage)
    if value < 0 then
        return 0
    end
    return value
end

local function setPlayerLevelSafe(cid, level)
    local targetExp = getExperienceForLevel(level)
    local currentExp = getPlayerExperience(cid)
    doPlayerAddExperience(cid, targetExp - currentExp)
end

function onSay(cid, words, param)
    if getPlayerStorageValue(cid, config.cooldownStorage) > os.time() then
        doPlayerSendCancel(cid, "Wait a moment before resetting again.")
        return true
    end

    if config.needVipStorage then
        if getPlayerStorageValue(cid, config.vipStorage) < os.time() then
            doPlayerPopupFYI(cid, "Only VIP account can reset.")
            return true
        end
    end

    if config.needPz and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
        doPlayerSendCancel(cid, "You need to be in a Protection Zone.")
        return true
    end

    if config.needNoBattle and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
        doPlayerSendCancel(cid, "You need to leave battle first.")
        return true
    end

    if config.blockWhiteSkull and getCreatureSkullType(cid) == SKULL_WHITE then
        doPlayerSendCancel(cid, "You can't reset with White Skull.")
        return true
    end

    if config.blockRedSkull and getCreatureSkullType(cid) == SKULL_RED then
        doPlayerSendCancel(cid, "You can't reset with Red Skull.")
        return true
    end

    if config.needPremium and not isPremium(cid) then
        doPlayerSendCancel(cid, "You need a Premium Account to reset.")
        return true
    end

    local resets = getResets(cid)
    if config.maxResets > 0 and resets >= config.maxResets then
        doPlayerSendCancel(cid, "You reached the reset limit.")
        return true
    end

    local level = getPlayerLevel(cid)
    if level < config.needLevel then
        doPlayerSendCancel(cid, "You need " .. (config.needLevel - level) .. " more levels to reset.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return true
    end

    setPlayerStorageValue(cid, config.cooldownStorage, os.time() + config.cooldown)
    setPlayerStorageValue(cid, config.storage, resets + 1)
    setPlayerLevelSafe(cid, config.resetToLevel)

    if config.changeVocation then
        doPlayerSetVocation(cid, config.newVocation)
    end

    if config.teleportToTemple then
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    end

    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
    doPlayerPopupFYI(cid, "[Reset: " .. (resets + 1) .. "] Success! Level set to " .. config.resetToLevel .. ".")
    return true
end


try this talkaction instead — your old one updates players table + removes the creature while online, that freezes a lot of 0.x builds
also fix the elbot line, auto 1 with empty conditions spams !reset
auto 2000 listas 'Auto Reset' | if [$level >= 717217 && $inpz == 1] say '!reset'
 
Back
Top