Ir para conteúdo

Featured Replies

Postado

Alguem poderia me ajudar? tenho uma script que npc adiciona uma nova voc(ultra god) so que ele so ta adicionando se o player tiver cm "reset" queria tirar esse reset e colocar pra o npc da a voc mesmo se n tivesse reset

 

 

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
local tab = {
    item = {2144, 500}} -- {itemID, count}

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('???')
focus = 0
talk_start = 0
end
end


function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Ola! Se voce esta pronto, diga "ultra god".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Hey!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'ultra god') and getPlayerStorageValue(cid,99023) == 4 then
selfSay('Desculpe, mas voce já é ultra god.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'ultra god') and (getPlayerLevel(cid) < 800 and getPlayerStorageValue(cid,99023) ~= 4) then
selfSay('Apenas level 800 ou mais podem virar ultra god.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'ultra god') then
selfSay('Realmente quer isto?')
talk_state = 2
--_GOKU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) >= 800 and getPlayerVocation(cid) == 473 then        
if (getPlayerItemCount(cid, tab.item[1]) >= tab.item[2]) and
            doPlayerRemoveItem(cid, tab.item[1], tab.item[2])then
doUltragod(cid,560,499)
else
talk_state = 0
end
 

  • 1 year later...
Postado

@menta2 @paladin34 Olhei o script aqui, e a unica coisa que ele cobra é se o jogador é level 800 e se ele tem 500 unidades do item com id 2144, no meu ponto de vista esse reset é um sistema que quando o jogador atinge x level, ele pode ser resetado, e ai ele vai lá e fala com o npc, mas em fim. Tenta esse script aqui. Se não for assim, me explica mais sobre o script, o que é pra remover. Posso estar falando besteira, pois estou começando agora no ramo de script.

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('???')
focus = 0
talk_start = 0
end
end


function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Ola! Se voce esta pronto, diga "ultra god".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Desculpe, ' .. getCreatureName(cid) .. '! Hey!.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'ultra god') and getPlayerStorageValue(cid,99023) == 4 then
selfSay('Desculpe, mas voce já é ultra god.')
focus = 0
talk_start = 0
elseif msgcontains(msg, 'ultra god') then
selfSay('Realmente quer isto?')
talk_state = 2
--_GOKU_--
elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerVocation(cid) == 473 then        
doUltragod(cid,560,499)
talk_state = 0
end

 

Editado por Phineasz (veja o histórico de edições)

Meu Curso sobre Programação para OTServer

Programando OTServer

 

Peça o seu script! Entre agora mesmo no grupo

Developing

 

Conteúdos:

Mostrar conteúdo oculto

 

Discord: Belmont#7352

Não esqueça do REP+ :)     

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo