Postado Julho 15, 2018 6 anos Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). TFS 1.3 Base: Qual erro está surgindo/O que você procura? Olá galera, estou tendo erro ao usar o sistema de reset, ele fala que vai desconectar o char mas nao desconecta nem reseta e aparece esse erro no console: Lua Script Error: [Main Interface] in a timer event called from: (Unknown scriptfile) data/talkactions/scripts/reborn.lua:26: attempt to call global 'setCreatureMaxHealth' (a nil value) stack traceback: [C]: in function 'setCreatureMaxHealth' data/talkactions/scripts/reborn.lua:26: in function 'addReset' data/talkactions/scripts/reborn.lua:60: in function <data/talkactions/scripts/reborn.lua:58> Alguem poderia me ajudar? Você tem o código disponível? Se tiver publique-o aqui: Spoiler local config = { minlevel = 150, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 0, --- preço acrescentado por reset percent = 100, ---- porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, levelbyreset = 0 --- quanto de level vai precisar a mais no próximo reset } --- end config local function getResets(uid) local resets = getPlayerStorageValue(uid, 378378) if resets < 0 then resets = 0 end return resets end local function addReset(cid) local resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) local hp = getCreatureMaxHealth(cid) local resethp = hp*(config.percent/100) setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*(config.percent/100) setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) local guid = getPlayerGUID(cid) doRemoveCreature(cid) local description = resets+1 db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..description.."]' WHERE `players`.`id`= ".. guid) db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. guid) return true end function onSay(cid, words, param, channel) local newPrice = config.price + (getResets(cid) * config.priceByReset) local newminlevel = config.minlevel + (getResets(cid) * config.levelbyreset) if param == "quantity" then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have a total of '..getResets(cid)..' reset(s).') end if getResets(cid) >= config.maxresets then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'You already have reached the maximum of '.. config.maxresets.. ' resets!') elseif getPlayerMoney(cid) < newPrice then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'Its necessary to have at least '..newPrice..' gp\'s for reseting!') elseif getPlayerLevel(cid) < newminlevel then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'The minimum level for reseting is '..newminlevel..'!') end doPlayerRemoveMoney(cid,newPrice) addEvent(function() if isPlayer(cid) then addReset(cid) end end, 3000) local number = getResets(cid)+1 local msg ="---[Reset: "..number.."]-- You have reseted! You'll be disconnected in 3 seconds." doPlayerPopupFYI(cid, msg) return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. Editado Julho 15, 2018 6 anos por Mayke Fleury (veja o histórico de edições)
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.