Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 6 years ago

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!

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. Jexpler 63 — 6y
0
Make sure it is a textbutton and not a textbox; textboxes don't have a click event. 522049 152 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

0
Is it possible for a TextBox to make a sound? Because that's what I want... CaptainAlien132 225 — 6y
0
So not on click? Because the script shows that when it is clicked, then a sound plays. starwars5319 7 — 6y
Ad

Answer this question