Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont this music button work?

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!

1 answer

The code has to be in a LocalScript for "game.Players.LocalPlayer" to work.

3 comments

0

It is in a localscript

0

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)

0

Solved!

This discussion is preserved as it was. New answers, comments, and votes are closed.