a person gave me this wonderful script (couldnt have done it with out ya) but i can't figure out how to make it have multiple dialogs in one. (multiple sentences in one chat) and it also stays on screen forever, it needs to fade after a small time. how can i achieve these things?
this is the script inside the textlabel
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.1)
end
end
Dialogue.OnClientEvent:Connect(function(msg)
TextLabel.Parent.Parent.Enabled = true
setText(msg)
end)
this is the script inside the proximityprompt
local RS = game:GetService("ReplicatedStorage")
local DialogueEvent = RS:WaitForChild("Dialogue")
local Prox = script.Parent
Prox.Triggered:Connect(function(plr)
DialogueEvent:FireClient(plr, "hey there, want some snacks")
end)
also, it has a remoteevent in replicated storage

4 comments
i keep getting this output error message: Players.omorizz.PlayerGui.ScreenGui.Frame.TextLabel.LocalScript:43: attempt to index nil with number , im not sure whats wrong?
Is the table already made? Is the table's content are string? Did you put a specific index in the table?
And is the second indexed string of the table nil or not?
i rewrote the script and it works perfectly now! (i still don't know what happened) thank you so much for your help!