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

How do you make a TextBox make a sound for the clicker when it is clicked?

I am completely stumped on this, the sound never plays and I've tried everything I can find. This is what I have:

script.Parent.Parent.MouseButton1Click:connect(function()
script.Click:Play()
end)

I also have another question. How do I make a TextBox register the typed letter, but have the user see something like "*" like passwords do? I can't really figure anything on this out, but if you can help me that would be good. I am also somewhat a noob at scripting, so please go easy on me!

2 comments

0

What are the properties of the sound set to? Also, will you show me the explorer? Because for the mousbutton1click, it should locate the button.

0

Make sure it is a textbutton and not a textbox; textboxes don't have a click event.

1 answer

To answer your first question: First, you should make sure that it is a TextButton, and not a TextBox. Next, make sure it is a LocalScript. Also, the script.Parent.Parent is the ScreenGui, so it should be a script.Parent. Also, is the sound inside of the LocalScript? If not, then put it inside of it. The script should look like this now.

script.Parent.MouseButton1Click:connect(function()
	script.Sound:Play()
end)

Then, the place with the Gui must have the children of "ScreenGui, TextButton, Script, and Sound". I don't know the answer to the second question, however.

2 comments

0

Is it possible for a TextBox to make a sound? Because that's what I want...

0

So not on click? Because the script shows that when it is clicked, then a sound plays.

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