I'm trying to make it an "on" and "off" switch just by clicking it again and I can't get it right. When I click it the first time it starts, the second time it SHOULD pause, but it doesn't.
local Yes = 1
local function onclick (click)
if Yes == 1 then
script.parent.SweetJams:Play()
end
Yes = 2
end
if script.Parent.ClickDetector.MouseClick:Connect(onclick)and Yes == 2 then
script.parent.SweetJams:Stop()
end

4 comments
Sound:Pause()?You set "Yes" to 2, and you check if its 1 or 2, but you never set it to 1, except when you set the variable.
next time put it in the answer box since you didn't just copy/paste code to help, but you showed me an error that I then fixed. You didn't ONLY help. Thanks :D
I put an answer bud.