Hello guys, I just wanted to know when I press this button "Script Below" I want it to play music, please can someone tell me!
BoolValue = script.Parent.Parent.EmergencyLight1.Toggle function onClick() if BoolValue.Value == false then BoolValue.Value = true print(BoolValue.Value) else BoolValue.Value = false end end script.Parent.ClickDetector.MouseClick:connect(onClick)
Best regards, Nathan.
PS: Used random tag since no tag available for the question I am asking.
Ok. So what you need to do is put a sound in workspace or the part (You need to change it depending on where)
BoolValue = script.Parent.Parent.EmergencyLight1.Toggle sound=game.Workspace.Sound -- Change this to wherever the sound is, and the sounds name --Im not sure when you want it to play, So I will put it next to the print, and you can move it. function onClick() if BoolValue.Value == false then BoolValue.Value = true print(BoolValue.Value) sound:Play() else BoolValue.Value = false end end script.Parent.ClickDetector.MouseClick:connect(onClick)