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

How do you make every single button have a sound?

2 answers

✓ Accepted answer

put the code below in a local script inside of a screen gui.

for _, v in pairs(script.Parent:GetDescendants()) do
	if v:IsA("TextButton") then
		v.MouseButton1Click:Connect(function()
			sound:Play()
		end)
	end
end

hope this helps, and remember do not put this inside of a textbutton or any other object, just a local script inside of the screen gui.

6 comments

0

What I ment was a script that find every single button in-game and when you click it it plays a sound including the core ui

0

@Meltronics oh ok! I will update the script.

0

Thank you!! Just sorry to bother you again is there a way that you just put the script in StarterGui and it would do something like :FindFirstChildOfClass("ScreenGui"):FindFirstChildOfClass("TextButton").MouseButton1Click:Connect(function()

0

you can! just simply add the script inside of the starter gui and dont edit anything.

0

could you write the script because i might mess it up

0

No, just move it into startergui and thats all.

Simple, Just follow this script! Please accept and upvote if helped!

script.Parent.MouseButton1Click:Connect(function()
    sound:Play
end)

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