antiblock
https://i.imgur.com/aJ17bf7.gif
  • Chatbox

    Did you check out our Discord? https://discord.gg/FFdvMjk9xA
    You don't have permission to chat.
    Load More
SpartacusWaR

[DÚVIDA] Quest Aparecer Com Item

4 posts in this topic

Estou colocando a quest do armazém mas preciso que ela apareça somente se o usuário tiver um item no inventario. 

 

 

if id_idem == id_idem.inventario  then

    quest stash begin
    state start begin --Status when nothing is open
     ..................

    end -- end_of_state: use
    end -- end_of_quest

end

 

obs... só estou na dúvida no if para verificar se o usuário possui o item no inventario: caso ela tenha a quest vai aparecer!
Alguém pode me ajudar? 

Share this post


Link to post
Share on other sites
antiblock
diamwall

if pc.count_item (ID DO ITEM) >= 1 then

 

Usa essa linha de comando para verificar se tem o item.

Share this post


Link to post
Share on other sites

Eu repensei e achei melhor criar ela para não funcionar se o usuário estiver no mapa vip.

 

quest armazem_portatil begin
	state start begin  
		when 40004.use begin   
			say("Deseja abrir o Armazem?")   
			local armazem = select("Sim","Fechar")   
			if pc.get_map_index() != 215 then
				if armazem == 1 then   
					syschat("Abriu o armazem")   
					game.open_safebox()   
					setskin(NOWINDOW)   
					return   
				end   
				if armazem == 2 then   
					return   
				end  
			else
				syschat("Não pode abrir o armazem no mapa vip")   
				return
			end
		end
	end
end

pode verificar se estou fazendo corretamente?

Share this post


Link to post
Share on other sites

Bom por partes.. na vdd essa quest não funciona..

----------------------------------------------
--Nome:		Armazem
--Criador:	Lost
--Destinatário:	CyberGamers
--(Lua) Source Code
----------------------------------------------
quest armazem_portatil begin
	state start begin
		when 40004.use begin
			local map = pc.get_map_index()
			say("Deseja abrir o Armazem?")
			local armazem = select("Sim","Fechar")
			if armazem == 1 then
			if map == 21 then
			syschat("Você não pode abrir aqui.")
			return
			end
			syschat("Abriu o armazem")
			game.open_safebox()
			setskin(NOWINDOW)
			return
			end
		end -- w
	end -- s
end -- q

 

De nada... onde esta o 21 altera para o mapa que vc quiser.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now