Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When player types, how do every letter play a sound?

So I see many games with that, whenever your player types, every letter has a sound effect like a typewriter. But I can't seem to replicate it. Any help will be great!

This: https://www.youtube.com/watch?v=wtpi5iuxJd8

1 answer

✓ Accepted answer
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(k)
if UIS:GetTextBoxFocused() then
script.Sound:Play()
end
end)

Make this a LocalScript with a Sound named Sound parented to it.

EDIT:

local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(k)
if k.KeyCode == Enum.KeyCode.Enter then
for i = 1, string.len(UIS:GetTextBoxFocused().Text) do
script.Sound:Play()
wait(0.1)
end
end
end)

3 comments

0

It worked a different way than I was expecting...

0

It worked differently as I expected, but it works. I was expecting on when the player entered the chat, then it would play the sound depending on how many letters the player typed.

0

Okay, I'll add a version for what you need.

This discussion is preserved as it was. New answers, comments, and votes are closed.