Wanting to make a game that uses dialogs?
With this module it makes dialogs simple!
Features
- Dialog Character Image.
- Three Dialog Choices
Example use:
server script:
--// Services
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--// Vars
local Dialog = ReplicatedStorage:WaitForChild("Dialog")
local TutorialDialog = {
Settings = {
Dialog = "Would you like to start the tutorial?",
Image = "rbxassetid://5205790785",
},
Options = {
[1] = "Yes",
[2] = "No",
}
}
Players.PlayerAdded:Connect(function(Player)
task.wait(5)
local WantsToDoTutorial = Dialog:InvokeClient(Player, TutorialDialog.Settings, TutorialDialog.Options)
repeat task.wait() until WantsToDoTutorial ~= nil
print("Wants To Do Tutorial: "..tostring(WantsToDoTutorial))
end)
local script:
--// Services
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--// Modules
local DialogFunc = ReplicatedStorage:WaitForChild("Dialog")
local Module = require(script:WaitForChild("Module"))
Module.Initialize()
--// Vars
local DialogEvent = ReplicatedStorage:WaitForChild("Dialog")
local Option = Module.OptionValue
function createDialog(Settings, Options)
Module.updateDialog(Settings, Options)
Option:GetPropertyChangedSignal("Value"):Wait()
Module.CloseDialog()
return Option.Value
end
--// Connections
DialogEvent.OnClientInvoke = createDialog
Click here for a video example.
Get the module here!
Credit for the UI: Bylocks