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

Surfacegui not toggling music when clicked. Help?

When I click the button to toggle it, it does nothing My hierarchy is workspace>Furniture>Radio>Sign>SurfaceGui>TextButton>LocalScript

script.Parent.MouseButton1Click:connect(function()
	if script.Parent.Parent.Parent.Parent.Music.Volume == 0.8 then
		script.Parent.Text = ('(OFF)')
		script.Parent.Parent.Parent.Parent.Music.Volume = 0
	else
		script.Parent.Text = ('(ON)')
		script.Parent.Parent.Parent.Parent.Music.Volume = 0.8
	end

end)

1 comment

0

You need to put the SurfaceGui into the StarterGui and Adornee to the Part

1 answer

Well.... why is this in workspace? all uis objects have to be put in the StarterGui service in order for them to work, and since they are local, you gotta use a local script not a server script (a server script is pretty much the normal script you use most of the times)

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