Dialogue Kit V1
Dialogue Kit V2 is out now! Check it out here.
I haven’t seen anyone do Dialogues the way I have, which is why this exists!
I made Dialogue Kit V1 to provide Roblox Developers with a quick & easy way to interact with NPC’s.
You can create a simple dialogue by going into the “Dialogues” ModuleScript and editing everything in there, everything has been left with a note so you can learn what to do there, all the notes are listed in the Information script as well.
You may be asking, how easy is it to create a dialogue with Dialogue Kit V1?
To put it simply: Dialogue Module > Edit Content & Title > Add optional replies > Define where the dialogue should be brought up > Edit settings > Done.
How the system works
A LocalScript reads a Dialogue created inside of a ModuleScript named Dialogues, which is used for making pretty much everything based around the Dialogues.
The LocalScript checks the “DialogueButton” part of the module for a ProximityPrompt or a ClickDetector and if none is found it utilizes the Touched event.
It then reads everything else inside of the Dialogue that was triggered, displaying everything on the Dialogue Gui.
Features
The system features a lot of things that you should be looking for, you can always suggest something to me if you’d like.
Replies
The kit includes a system to create replies so you can reply to NPC’s or anything else you’d use this kit for, they are completely optional.
The kit is built on a “Layer” system. Each reply has a new layer and each reply is displayed on specific layers.
A reply would go in DialogueReplyInfo and would look like this:
Reply1 = {
ReplyTitle = "wow so cool!"; -- Button text displayed
ReplyContent = {"i know!!!!!!"}; -- Next piece of content.
ReplyButtonLayer = 2;
ReplyPosition = 1; -- Time for the displayed content where the reply is displayed. Example: for content like {"Content1", "Content2"}, ReplyPosition = 2 would be Content2, and ReplyPosition would be Content1 and so on.
ReplyButtonLayerDisplay = 1; -- Which layer the button will be displayed at.
GridPosition = 1;
ContentSound = "rbxassetid://"; -- Sound to play every time a new piece of content is displayed. Useful for adding Voices. Leave blank if you don't want a sound, be sure to keep "rbxassetid://" when adding a sound.
};
This will create a reply on DialogueLayer 1.
Sounds
The kit features a few of ways to add sound to your dialogue. These settings are all separate, so you can make them specific!
From the perspective of the Dialogues script:
- TypewriterSound - Sound that is played every time a letter is typed onto the Dialogue.
- TypewriterRandomPitch – Makes the TypewriterSound change it’s pitch randomly between 0.8 & 1.25.
- StartingContentSound - Sound played when the Dialogue starts. Useful for adding voice lines.
- BackgroundMusicID - Sound that plays in the background for the duration of the dialogue.
Run scripts
You can also run scripts at specific parts of the Dialogue if you’d like, you can utilize this if you want to create animations for an NPC.
Example for killing the player:
-- Dialogues ModuleScript
Script1 = {
ScriptInstance = script.Parent.Parent.Parent.killPlayer; -- The script you want to execute
ScriptContentExecute = 1; -- When the script should be executed (Same logic as showing replies.)
ScriptDialogueLayer = 4; -- Layer which the Script will be executed.
};
-- Another script in StarterGui named "killPlayer" which has Enabled set to false.
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Health = 0
That’s not all! This system features a lot more, which can be found in the Dialogues module!
Video showcasing all the features
Quick Setup
First off, get the model which was listed at the top of this post, then you can feel free to insert the model.
Now, make sure you put everything in its designated place!
DialoguePrompts > Workspace
Dialogues > StarterGui
To create your first dialogue, go into the Dialogues ScreenGui, go to MainScripts & go to Dialogues. (ModuleScript)
Once inside, read the notes to learn how to use them and how they are used. Further documentation on them can be found in the Information script in the folder which comes with the model.
Note: Make sure DialogueButton is not “nil” otherwise your dialogue will not work!
Conclusion
Finishing things off, I hope you like my system and I hope it is a good use to you. I am open for suggestions, so feel free to suggest any new features to me.
Thanks!