Make pitchrandomized for Sound for each letter

So I made this where if you type any text in the chat it’s gonna make a sound for each letter so like the sans thing from undertale. But how can I make the pitch randomized? Because it’s bland just at the same pitch and doesn’t sound good. How can I do that? Here is the script:

local sound = script.Sound

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		for i = 1,#msg do
			sound:Play()
			sound.Ended:Wait()
		end
	end)
end)

use a PitchShiftSoundEffect and set the octave something like

math.random(1,10)/10

How would it look like on the script?

image
Here is what it would look like in the explorer
image
and here is what the script would contain this
if you would like me to explain further i could
the script inside the sfx is just for demonstration

1 Like

Mine looks like this: chat

And how can I make it randomized for each letter? script

I believe if you just add the PS.Octave = math.random(1,10)/10 below or any of the Sound:Play() or inside of those 2 lines it should randomize each time

1 Like

Yeah It worked now. you were right about it under play

Happy developing, Glad it worked

1 Like