MrDialogue defines conversations as graphs composed of line, choice, branch, action, and end nodes. Dialogue state, conditions, and actions run on the server. The package includes a client interface and supports custom adapters.
Showcase¶
See MrDialogue in action in this short dialogue showcase.
Installation¶
Install MrDialogue with Wally or get the model from the Roblox Creator Store:
Install with Wally Get it from Creator Store
Example¶
MrDialogue runs on both the client and server. Start the client runtime once, then start server-owned dialogue definitions in response to player interactions.
Client¶
Create a LocalScript under StarterPlayerScripts:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MrDialogue = require(ReplicatedStorage.Packages.MrDialogue.Client)
MrDialogue.Start()
Server¶
Create a server Script under a ProximityPrompt:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MrDialogue = require(ReplicatedStorage.Packages.MrDialogue.Server)
local dialogue = MrDialogue.new({
format = 1,
id = "directions",
entry = "greeting",
nodes = {
greeting = {
type = "line",
text = "Do you need directions?",
next = "answer",
},
answer = {
type = "choice",
options = {
{ id = "yes", text = "Yes.", next = "directions" },
{ id = "no", text = "No, thanks.", next = "done" },
},
},
directions = {
type = "line",
text = "Follow the road north.",
next = "done",
},
done = {
type = "end",
},
},
})
script.Parent.Triggered:Connect(function(player)
local session, startError = dialogue:Start(player)
if not session then
warn(`Could not start dialogue: {startError}`)
end
end)