Ir para conteúdo

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0

Fiz um rapidinho aqui para você.

 

talkactions.xml:

 

<talkaction words="!reset" script="reset.lua"/>

 

reset.lua:

 

  Mostrar conteúdo oculto

 

 

Configure aqui:

local limite = 2 -- Limite de resets
local lvl = 10 -- Level que o player ficará após o reset

 

Para resetar, fale !reset.

Link para o comentário
https://xtibia.com/forum/topic/196031-pedido-sistema-de-reset-limitado/#findComment-1359049
Compartilhar em outros sites

  • 0

Refiz o do @luck algumas partes

 

function onSay(cid, words, param)
local limite = 2 -- Limite de resets
local lvl = 10 -- Level que o player ficará após o reset
local stor = 1278
if getPlayerStorageValue(cid, stor) == limite then
doPlayerSendCancel(cid, "Sorry, but you can't reset more than "..limite.." times.")
return true
elseif getPlayerStorageValue(cid, stor) == -1 then
elseif getPlayerLevel(cid) >= 500 then
db.executeQuery("UPDATE `players` SET `level` = "..lvl.." WHERE `id` = "..getPlayerGUID(cid))
setPlayerStorageValue(cid, stor, 1)
return true
elseif getPlayerStorageValue(cid, stor) == 1 then
elseif getPlayerLevel(cid) >= 1000 then
db.executeQuery("UPDATE `players` SET `level` = "..lvl.." WHERE `id` = "..getPlayerGUID(cid))
setPlayerStorageValue(cid, stor, 2)
doRemoveCreature(cid)
end
return true
end

Link para o comentário
https://xtibia.com/forum/topic/196031-pedido-sistema-de-reset-limitado/#findComment-1359882
Compartilhar em outros sites

  • 0

@SkyLigh

 

Cara, você só bagunçou o script. Declarou o "param" sendo que nem vai usar ele, adicionou linhas desnecessárias e o erro vai continuar da mesma forma.

 

@Noreply

 

Arrumei o script. Testado e funcionando.

 

talkactions.xml:

 

<talkaction words="!reset" script="reset.lua"/>

 

reset.lua:

 

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/196031-pedido-sistema-de-reset-limitado/#findComment-1359898
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...