Typewriter effect not playing audio

Trying to make a cool sound effect when the typewriter writes a number, but it dosent play, please help?

local textl = script.Parent:WaitForChild("DialogBox"):WaitForChild("TextLabel")

wait(1)

local function type(object,text)
	for i = 1,#text do
		script.Parent:WaitForChild("Sans Talk"):Play()
		object.Text = string.sub(text,1,i)
		
		wait(0.05)
	end
end

type(textl,"* Its a beautiful day outside...")
wait(1)
type(textl,"* Birds are singing, flowers are blooming...")
wait(1)
type(textl,"* On days like this, kids like you....")
wait(2)
type(textl,"* SHOULD BE BURNING IN HELL")

That is because “type” is a keyword, as highlighted in blue.

That isn’t the problem that the OP is having. Try looking at this API as it explains the ContentProviderService, PreloadAsync and other things having to do with sound.

1 Like