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

How do I make a part play a sound when clicked?

Asked by 4 years ago
Edited 4 years ago

I've been trying to make a lantern play a switch sound when it turns on in Roblox Studio, but it hasn't been working. I've tried many different scripts, ClickDetectors, etc, but none of it is working. I've been using this script along with a ClickDetector and a sound:

script.Parent.ClickDetector.MouseClick:Connect(function() game.Workspace.Sound:Play(Sound ID Goes Here)

end)

1 answer

Log in to vote
2
Answered by 4 years ago

Put the sound ID in the properties of the sound and remove the sound id in

game.Workspace.Sound:Play(Sound ID Goes Here)
Ad

Answer this question