Ir para conteúdo

Featured Replies

Postado

Olá, eu estou com o seguinte problema, se alguem puder mi ajudar serei muito grato, ou mesmo mi indicar como e onde estudo esse possível error.. Bom eu importei meu servidor para 8.60 e estou editando  pasta por pasta a unica coisa que não estou conseguindo fazer é mudar a versão dos meus scripts, estou precisando muito de uma luz, eu não sou leigo no assunto (script) mais essa mi pegou de surpresa ----> meu script 

 

Error

[0:52:37.847] [Error -NpcScript Interface]
[0:52:37.847] data/npc/scripts/chibigohan.lua:onCreatureSay
[0:52:37.847] Description:
[0:52:37.847] data/npc/scripts/chibigohan.lua:39: attempt to call global ' getPlayerPz' <a nil value>
[0:52:37.847] stack traceback:
[0:52:37.847] data/npc/scripts/chibigohan.lua:39: in fuction <data/npc/scripts/chibigohan.lua:36>

 

----> meu 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('Ueeeeeee.')
          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 and getPlayerPz(cid) <= 0 then
        
            selfSay('Ueeeee Please ' .. getCreatureName(cid) .. '! Can you help me? Ueeeee ueee')
            focus = cid
            talk_start = os.clock()
        

      elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
          selfSay('Sorry, ' .. getCreatureName(cid) .. '! Ueeee.')

      elseif focus == cid then
        talk_start = os.clock()

            if msgcontains(msg, 'yes') then
             if getPlayerStorageValue(cid,8000) >= 1 then
        selfSay('Sorry You Cant Do this saga.')    
            else        
                travel(cid, 132, 610, 7)
                    selfSay('Ueeeeeee!')
                    focus = 0
                    talk_start = 0

            
end

            elseif msgcontains(msg, 'asdasdasdasdasdasa') then
                if pay(cid,100) then
                    travel(cid, 117, 101, 7)
                    selfSay('Let\'s go!')
                    focus = 0
                    talk_start = 0
                else
                    selfSay('Sorry, you don\'t have enough money.')
                end

            
                

        elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
            selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
            focus = 0
            talk_start = 0
        end
    end
end

function onThink()
    doNpcSetCreatureFocus(focus)
      if (os.clock() - talk_start) > 45 then
          if focus > 0 then
              selfSay('Next Please...')
          end
              focus = 0
      end
     if focus ~= 0 then
         if getDistanceToCreature(focus) > 5 then
             selfSay('Good bye then.')
             focus = 0
         end
     end
end
 

 

queria saber como faço para fazer ele ler na distro 8.60 sem bugar

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Chibi Gohan" script="data/npc/scripts/chibigohan.lua" walkinterval="2000" floorchange="0">
    <health now="150" max="150"/>
    <look type="28" head="132" body="79" legs="97" feet="132" corpse="2212"/>
<parameters>
</parameters>
</npc>

 

se poder ajudar Estarei Grato!!

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

Postado

MMHUCMQ.png  Esta é uma mensagem automática, este tópico foi movido para a área correta.
  Regras do fórum: http://www.tibiaking.com/forum/topic/1281-regras-gerais/#comment-7680

Este tópico foi movido:
De: Scripting OTServ > OTServ > Monsters e NPCs
Para: Suporte OTServ > OTServ > Suporte de Scripts

Postado

Cara, ao menos no OT que eu uso não há a função  'getPlayerPz(cid)'.

 

Se entendi bem vc checa se o Player está atacando ou não, não é?

 

Então troque:

getPlayerPz(cid) <= 0

Por:

(not isPlayerPzLocked(cid))

Deverá dar o mesmo efeito.

 

Ajudei? Rep+.

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

Postado
  • Autor

não funcionou esse script  não esta reconhecendo 

getPlayerPz(cid) <= 0

ele é um script de 8.0 será que tem  um 8.60 com a mesma função ?

já arrumei 

Postado

Faz o seguinte.

 

Vá na pasta 'doc' (no mesmo lugar onde está a pasta 'data') e abra o arquivo 'LUA_FUNCTIONS' com um editor de texto (pode ser o NotePad C++) e cole aqui.

 

Neste arquivo estão as funções '.lua' que estão 'escondidas' dentro do 'Forgotten.exe'.

 

Se no meio destas funções não houver nada que possamos usar, aí crio uma e te ensino como usá-la no server. Fácin.

 

Abraço.

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

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.7k

Informação Importante

Confirmação de Termo