Ir para conteúdo

Featured Replies

Postado
  Em 17/01/2018 em 13:11, FaaSouzax disse:

@Nazo Então eu tentei ali, e arrumei a linha 6 que estava dando erro e apareceu esse outro

 


[Warning - NpcScript::NpcScript] Can not load script: Archery.lua
data/npc/scripts/Archery.lua:19: 'then' expected near 'npcHandler'
 

Tente isso:

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end 

local items = {{21699, 1},{24301, 1}, {23495, 1}} --id do item, quantidade 

function creatureSayCallback(cid, type, msg)
	local msg, player = string.lower(msg), Player(cid)
	if not npcHandler:isFocused(cid) then
		if isInArray({"hi", "hello"}, msg) then
			npcHandler:addFocus(cid)
			if player:getStorageValue(56473) == -1 then
				if player:getStorageValue(56473) == -1 then
					npcHandler:say("Hi, ".. player:getName().."! hello young warrior, I realized that you are looking for some adventures, if you can {help} me I can ask one of my servants to take you to a mysterious island.?", cid)
					npcHandler.topic[cid] = 1
				else
					npcHandler:say("help, ".. player:getName().."! So you are interested? well, what I ask is simple, I have lost 3 chests with personal treasures through the forest, manholes and building, can you bring me the items that they contain??", cid)
					npcHandler.topic[cid] = 2
				end	
			else
				npcHandler:say("Hi, ".. player:getName().."! Can you find my treasures?", cid)
				npcHandler.topic[cid] = 3
			end
		else
			npcHandler:say("I have already told my servant that I can help you to reach such an island.", cid)
			npcHandler.topic[cid] = 0
			npcHandler:releaseFocus(cid)
		end
	elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 1 then
		player:setStorageValue(56473, 1)
		npcHandler:say("Ok, now I will wait for you. Be careful!", cid)
		npcHandler.topic[cid] = 0
		npcHandler:releaseFocus(cid)
	elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 2 then
		player:setStorageValue(56473, 1)
		npcHandler:say("Ok, now I will wait for you. Be careful!", cid)
		npcHandler.topic[cid] = 0
		npcHandler:releaseFocus(cid)
	elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 3 then
		if player:removeItem(items[1][1], items[1][2]) then
			player:setStorageValue(56473, 1)
			npcHandler:say("Thanks! I'll tell my servant that I can take you to the island.", cid)
			npcHandler.topic[cid] = 0
		else
			npcHandler:say("Sorry, but you still have not found all my treasures.", cid)
			npcHandler.topic[cid] = 0
		end
	elseif msgcontains(msg, "no") and npcHandler.topic[cid] == 2 then
		npcHandler:say("Ok, I will wait a bit more.", cid)
		npcHandler.topic[cid] = 0
	elseif msgcontains(msg, "bye") then
		npcHandler:say("Bye.", cid)
		npcHandler:releaseFocus(cid)
	else
		npcHandler:say("What?", cid)
		npcHandler.topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

 

Programador PHP, Lua, Java, database administrator.

 

"Nada é verdade, tudo é permitido."

Requiescat in pace.

  • Respostas 13
  • Visualizações 869
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
  • Autor

@Nazo Sem nenhum erro quando dei reload, mas por causa dos outros erro o npc no server save nao apareceu, e agora quando vou cria-lo aparece esse erro.

 


Lua Script Error: [Npc interface]
data/npc/scripts/Archery.lua
data/npc/scripts/Archery.lua:62: attempt to index global 'npcHandler' (a nil value)
stack traceback:
[C]: in function '__index'
data/npc/scripts/Archery.lua:62: in main chunk
[C]: in function 'createNpc'
data/talkactions/scripts/place_npc.lua:11: in function
[Warning - NpcScript::NpcScript] Can not load script: Archery.lua

 

Postado
  • Solução

Sem criar a função não vai funcionar mesmo...

 

Mostrar conteúdo oculto

 

Tem um puta erro aqui:

image.png

 

Mas deixo isso com vocês...

Bruno Carvalho / Ex-Administrador TibiaKing

b.camara@live.com

 

  Em 26/12/2016 em 05:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

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