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

How to script a dialog?

I want me too know if I can script a dialog so when the player chooses a sertain reply something happens.

3 answers

✓ Accepted answer

Put this under the DialogChoice:

script.Parent.DialogChoiceSelected:connect(function() 
--script here
end)

1 comment

1

Okay i'll try it.

why do it not work. workspace -> npc -> head -> dialog -> script

local Box = game.ReplicatedStorage.Stuff.Box

script.Parent.DialogChoiceSelected:Connect(function(player, Choise)

	if Choise == script.Parent.DeliverBoxes then
	
		local Part = Box:Clone()
		Part.Parent = player.Backpack
	
	end

end)

1 comment

0

i put it in local script but it wont work. like he dont see i click on the button so he can do this

To create a NPC that a player can talk to is very simple:

  1. Choose the NPC you want to have dialog
  2. Right-Click "Head"
  3. Click insert object
  4. Choose Dialog
  5. Open properties and choose the initial prompt
  6. Right-Click "Dialog"
  7. Insert Dialog Choice to the dialog
  8. Choose what it will say and choose the response dialog

You probably get the point. You can also insert Dialog Choice to Dialog Choice to make that chat much longer!

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