How to make a checkbox for setting?

Hi

How do I make this a checkbox? I want it to turn on and off audio. This my localscript and it’s not working on the end half.

local audio = game.SoundService.Backgroundmusic
local checkbox = script.Parent

script.Parent.MouseButton1Click:Connect(function()
	checkbox.Visible = not checkbox.Visible
	if checkbox.Visible then
		audio.Volume = 1

	else
		audio.Volume = 0
	end
end)

EDIT: It has been been fixed!

(adding characters)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.