player = game.Players.LocalPlayer
button = script.Parent
song = script.Parent.Parent.Parent.Parent.forest
playing = false
button.MouseButton1Click:connect(function()
button.Text = "ON"
if playing == false then
song:Play()
playing = true
elseif
playing == true then
song:Stop()
button.Text = "OFF"
playing = false
end
end)
--Works in solo, doesnt work in game. please help!
COMMUNITY QUESTION
Why wont this music button work?
1 answer
The code has to be in a LocalScript for "game.Players.LocalPlayer" to work.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
It is in a localscript
I don't see any problems. What does the output say in the server? (Press F9 to open the console in your game and click "Server Console" tab)
Solved!