Page 1 of 1

what is wrong with thisfunction Hailed

Posted: Sat Oct 28, 2017 4:37 pm
by Ememjr

Code: Select all

function hailed(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	local conversation = CreateConversation()
	StartConversation(conversation, NPC, Spawn, "Good day to you.  I've been hearing reports that the Peat Bog isn't safe right now.  I hope you didn't have any trouble if you came in that way.")
	if not HasQuest(Spawn, 240) then
       AddConversationOption(conversation, "What kind of trouble is out in the bog?", "Option4")
	end
end
it worked until i added the if not hasquest portion

Re: what is wrong with thisfunction Hailed

Posted: Sat Oct 28, 2017 6:36 pm
by Jabantiz
StartConversation() needs to be after AddConversationOption(). Just like the name suggests it will start the conversation and send all the packets and I believe the conversation pointer gets nuked after that so using Add after can cause errors/crashes.

Re: what is wrong with thisfunction Hailed

Posted: Sun Oct 29, 2017 4:56 pm
by Ememjr
never noticed that but it does make since got it to work