#how to add sound effects to buttons in roblox studio

1 messages · Page 1 of 1 (latest)

prisma wolf
#

if you know how to add sound effects to buttons please help me

deft moss
#

button.activated:(sound:playy()))

prisma wolf
#

do i need to add another script or just put the code into the same script?

deft moss
#

idk probably same script

prisma wolf
#

ok thanks

#

its not working

#

is there a specfic script i should be using or what?

#

@deft moss

tall sedge
#

you can use any script

#

button.Activated:Connect(function()
Sound:Play()
end)

#

something like that

prisma wolf
sterile aspen
#
  1. Insert a Sound
    In the Explorer, go to StarterGui → open your ScreenGui.

Add a Sound object to the TextButton (or ImageButton) that you want to play the sound.

Set the SoundId property to the sound you want, e.g.:

rbxassetid://12345678

(Replace with a real sound asset ID. You can find sounds in the Toolbox.)

  1. Use a LocalScript for the Button Click
    Add a LocalScript inside the same button.

Paste this code:

lua
Copy
Edit
local button = script.Parent
local sound = button:WaitForChild("Sound")

button.MouseButton1Click:Connect(function()
sound:Play()
-- You can also add more code here, like opening menus or doing actions
end)