Roblox Studio Tutorials - January 13, 2022

How to Play Sounds When Clicked


Buzzy Beth


Download – Sound Script

How To – Play Sounds When Clicked

What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to play sounds when clicked!

  • Right now i’m just pulling out a part and then another part where i’ll be clicking, so that the sound can play.
  • Just a simple red button that i’ll be making right now, yeah looks pretty good! I’m just gonna go ahead and make sure that I anchor my parts, I always forget to but I won’t forget this time!
  • So inside of our part of our part that we want to click on, let’s go ahead and add a click detector and a sound.
  • Go ahead and paste the soundID that you want to use. So go ahead and copy that assetID, paste it in there, click enter and that’s the sound I want to use. Go ahead and adjust the volume to whatever you want, i’m going to do max volume 10, it’s really not that loud and then one more thing.
  • Let’s add a script inside of our part so there’s three things: so far our sound, click detector, and a script.
  • What we have right here is a function where script.parent.clickdetector.mouseclick essentially where anytime we click this part the sound is going to play – that’s it!
  • So if we go ahead and hop inside of our gameand then we click our red button a sound should play something like this!