Brightness setting low medium high not working (Solved)

script.Parent.MouseButton1Click:Connect(function()
	if game.Lighting.Brightness == 2 then
		game.Lighting.Brightness = 4
		script.Parent.Text = "HIGH"
		script.Parent.BackgroundColor3 = Color3.fromHSV(0.371917, 1, 0.796078)
	else
		if game.Lighting.Brightness == 4 then
			game.Lighting.Brightness = 0
			script.Parent.Text = "LOW"
			script.Parent.BackgroundColor3 = Color3.fromHSV(0.996889, 0.631373, 1)
		else
			if game.Lighting.Brightness == 0 then
				game.Lighting.Brightness = 2
				script.Parent.Text = "MEDIUM"
				script.Parent.BackgroundColor3 = Color3.fromHSV(0.125, 0.988235, 1)
			end
		end
	end
end)

so I’m making a settings thing where there is brightness, but it doesn’t work?

script.Parent.MouseButton1Click:Connect(function()
	if game.Lighting.Brightness == 2 then
		game.Lighting.Brightness = 4
		script.Parent.Text = "HIGH"
		script.Parent.BackgroundColor3 = Color3.fromHSV(0.371917, 1, 0.796078)
	elseif game.Lighting.Brightness == 4 then
		game.Lighting.Brightness = 0
		script.Parent.Text = "LOW"
		script.Parent.BackgroundColor3 = Color3.fromHSV(0.996889, 0.631373, 1)
	elseif game.Lighting.Brightness == 0 then
		game.Lighting.Brightness = 2
		script.Parent.Text = "MEDIUM"
		script.Parent.BackgroundColor3 = Color3.fromHSV(0.125, 0.988235, 1)
	end
end)

Is this a server script?

Also, come on, use RGB.

no its a localscript it inside of a button

I will code it for you once i have time. It will tween the brightess, Button color and have no errors.

Yes thank you, that would be lovely!

Glad to help. I have a custom settings UI With toggable stuff. So its easy for me to make this on the client.

What is your default brightness set to? If it’s set to 1, then there’s your problem.

can also be a fix. Not sure tho. but fancy button is on da way

Ima try that in about 20 minutes

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