i've been working on a dialog system for weeks now and i can't find any tutorials that are working for me! i don't really know scripting so i'd like some help with making a dialog system! E proximity prompt for npcs, or just stepping on a part to make dialog appear would work!
I personally use this.
First, Insert a RemotEvent named 'DIalogue' in the ReplicatedStorage.
Second, make a part and insert a ProximityPrompt. After, insert a regular Script into the Proximity Prompt, then write this.
Server
local RS = game:GetService("ReplicatedStorage") local DialogueEvent = RS:WaitForChild("Dialogue") local Prox = script.Parent Prox.Triggered:Connect(function(plr) DialogueEvent:FireClient(plr, "Hey there! This is a dialogue system! As you can see, the breakers work! It's used as a pause in a sentence.") -- You can use this if you want, useful if you're making multiple dialogues. end)
This will be used to send a signal to the Client that triggered the Proximity Prompt to execute the dialogue.
After doing these, make a GUI! Make your own design, put a localscript in the TextLabel (Dialogue Text). Then write this.
Client
local RS = game:GetService("ReplicatedStorage") local Dialogue = RS:WaitForChild("Dialogue") local Waits = { "!", ".", "?", ";", ":", "," } local TextLabel = script.Parent function setText(Text) for i = 1, #Text do TextLabel.Text = string.sub(Text, 1, i) for Index, Breakers in pairs(Waits) do if string.sub(TextLabel.Text, i, i) == Breakers then task.wait(0.2) end end task.wait(0.0050) -- Customize this if you want end end Dialogue.OnClientEvent:Connect(function(msg) TextLabel.Parent.Parent.Enabled = true setText(msg) end)
And that's a wrap! Test it out!