I’m making a dialogue script but the actual script looks messy, does anyone know how to simplify it?
local proximityprompt = game.Workspace.Dialog.Chillems.ProximityPrompt
local sfx = script.Parent.clicksound
local text = script.Parent.Frame.Text1
local debounce = false
local waitTime = 20
proximityprompt.Triggered:Connect(function()
if debounce == false then
debounce = true
script.Parent.Visible = true
text.Visible = true
text.Text = "G"
sfx:Play()
wait()
text.Text = "Ge"
sfx:Play()
wait()
text.Text = "Get"
sfx:Play()
wait(0.1)
text.Text = "Get o"
sfx:Play()
wait()
text.Text = "Get ou"
sfx:Play()
wait()
text.Text = "Get out"
sfx:Play()
wait(0.1)
text.Text = "Get out o"
sfx:Play()
wait()
text.Text = "Get out of"
sfx:Play()
wait()
text.Text = "Get out of"
sfx:Play()
wait(0.1)
text.Text = "Get out of m"
sfx:Play()
wait()
text.Text = "Get out of my"
sfx:Play()
wait(0.1)
text.Text = "Get out of my r"
sfx:Play()
wait()
text.Text = "Get out of my ro"
sfx:Play()
wait()
text.Text = "Get out of my roo"
sfx:Play()
wait()
text.Text = "Get out of my room"
sfx:Play()
wait(2)
text.Visible = false
script.Parent.Visible = false
sfx:Play()
sfx.Ended:Wait()
debounce = false
end
end)