How do you make a checkbox

Hello, I am wondering how can you make a checkbox in roblox studio.

I’m referring to something like this:
image

I tried to script it, but It was too complicated and it’s just not working

local muteORunmute = script.Parent.MuteOrUnmute
local lol = script.Parent.MuteOrUnmute.Check


script.Parent.MouseButton1Click:Connect(function()
	
	lol.Value = true
	
	lol:GetPropertyChangedSignal("Value"):Connect(function()
		
		if muteORunmute.Value == false then
			
			muteORunmute.Value = true
			print('its true')
			
		end
		
		
	end)
	
end)

task.wait(0.01)

script.Parent.MouseButton1Click:Connect(function()
	
	lol.Value = false
	
	lol:GetPropertyChangedSignal("Value"):Connect(function()
		
		if muteORunmute.Value == true then
			
			muteORunmute.Value = false
			print( "its false")
			
		end
		
	end)
	
end)

You can use ImageButtons to insert these checkbox images and make it a button as well. If you just want it to be an image like above then just use a ImageLabel.

Tutorial:

I am talking about the scripting, I already know all of this.

Are you making a music Mute/Unmute system??

You can make a Variable that defines the ImageButton and change the ImageId when the ImageButton is clicked. When the music.Volume = 1 the logo will have a normal music logo when the music.Volume = 0 the logo will have a cross through the music logo.

I have already helped you out with this just implement your music button into the coding and adjust it to your needs:

local music = game.Workspace.Music

script.Parent.MouseButton1Click:Connect(function()
	if music.Volume == 0 then
		music.Volume = 1
		-- logo changes
	else
		
		music.Volume = 0
		-- logo changes
	end
end)
2 Likes