if game.Workspace.Part.ClickDetector then play audio == ('142435409') end
I am trying to get a part when I click it, it will play a certain audio. Is this script correct for that?
sound = game.Workspace.Sound --Change this to whatever it is in your game function onClicked() sound:Play()--For it to play (142435409) you just should make an audio in workspace, and put that in the SoundId end script.Parent.ClickDetector.MouseClick:connect(onClicked)
If you are wanting it to play client-side make sure it is a Localscript first. If you are using click detectors then it should look something like this.
audio1 = game.Soundscape.Bomb --you can change this to whatever audio you want to play function onClicked() play audio1 end script.Parent.ClickDetector.MouseClick:connect(onClicked)
****I am not sure if that itself will work, but it is basically what is needed for the click detector. I predetermined the audio track to play(in this case "Bomb" from the Soundscape, to simplify the script later on.