Why doesn’t my ImageButton play this script? No errors, so I have no clue what the problem could be.
game.StarterGui.Menu.ImageButton.MouseButton1Click:Connect(function()
local TextLabel = script.Parent
local Text
local function SoundEffect()
local Sound = Instance.new("Sound", workspace)
Sound.Name = "TextSound"
Sound.SoundId = "https://www.roblox.com/asset/?id=10362620616"
Sound.PlaybackSpeed = 1
Sound.Volume = 1
Sound:Play()
coroutine.resume(coroutine.create(function()
wait(1)
Sound:Destroy()
end))
end
local function SetText(word)
Text = word
for i = 1, #Text do
TextLabel.Text = string.sub(Text, 1, i)
SoundEffect()
TextLabel.TextColor3 = Color3.fromRGB(255,255,255)
wait(0.05)
end
end
wait(3)
SetText("Dialogue Test, Dialogue Test, Dialogue Test, Dialogue Test, ")
wait(3)
SetText("Dialogue Test, Dialogue Test, Dialogue Test, Dialogue Test, ")
wait(1)
SetText("Dialogue Test, Dialogue Test, Dialogue Test, Dialogue Test, ")
end)