Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make dialogue different each time/after I talk to somebody?

1 answer

You can use DialogChoiceSelected like this:

dialog.DialogChoiceSelected:Connect(function(player, choice)
	if choice == lastChoice then
		--put code to swap dialog here
	end
end)

where dialog is the dialog instance and lastChoice is the DialogChoice instance that triggers the swap.

This only works in a LocalScript and does not fire when you select the goodbye choice, so you would need to make a custom goodbye choice for that.

4 comments

0

Could you tell me it more in depth like how i get the variable for lastChoice

0

and do i put it on Starterkit or the brick itself

0

lastChoice is just the DialogChoice that you want it to end with and trigger the swap, for example game.Workspace.TalkingBrick.Dialog.DialogChoice. Basically, it's the point in the dialog tree that you decide, where it makes it give you another dialog next time.

0

And since it needs to be in a LocalScript, put it in StarterPlayerScripts or StarterGui or something like that. You could connect it to a RemoteEvent if you want it to change the dialog for everyone in the server.

This discussion is preserved as it was. New answers, comments, and votes are closed.