Postado Janeiro 17, 2019 6 anos como transcreve esse script do tfs 0.4 para o tfs 1.3 a função do reset do meu tfs 1.3 Mostrar conteúdo oculto function getResets(uid) resets = getPlayerStorageValue(uid, 378378) if resets < 0 then resets = 0 end return resets end function addReset(cid) player = Player(cid) resets = getResets(cid) hp = player:getMaxHealth() resethp = hp*(config.percent/100) player:setMaxHealth(resethp) mana = player:getMaxMana() resetmana = mana*(config.percent/100) player:setMaxMana(resetmana) playerid = player:getGuid() player:setStorageValue(378378, resets+1) player:remove() description = resets+1 db.query("UPDATE `players` SET `description` = ' [Reset: "..description.."]' WHERE `players`.`id`= ".. playerid .."") db.query("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return true end <event type="Look" name="lookreset" script="lookreset.lua" /> function onLook(cid, thing, position, lookDistance) if isPlayer(cid) then resets = getPlayerStorageValue(cid, 378378)+1 doPlayerSetSpecialDescription(thing.uid, "\nResets: [" .. resets .."]") end return true end
Postado Janeiro 17, 2019 6 anos Solução @BilauX Em data/events/scripts/player.lua Na função: function Player:onLook(thing, position, distance) Adicione: if thing:isPlayer() then local resets = thing:getStorageValue(378378) if resets < 0 and 0 or resets then description = string.format("%s\nResets: %s.", description, resets > 0 and resets or "0") end end Se preferir você também pode usar na função: function Player:onLookInBattleList(creature, distance) Para mostrar os resets ao da look pela battle.
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.