I have a script that plays a sound every time you scroll. There's also a script that allows you to turn off the sound. If the script is disabled, the button turns red, but if the script isn't disabled, it should turn blue. Although it just turns white. Here's the script:
script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.ScrollSound.Disabled == false then script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.ScrollSound.Disabled = true script.Parent.Text = "Scroll Sound Effect: OFF" script.Parent.BackgroundColor3 = Color3.new(255, 0, 0) elseif script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.ScrollSound.Disabled == true then script.Parent.Parent.Parent.Parent.Parent.PlayerScripts.ScrollSound.Disabled = false script.Parent.Text = "Scroll Sound Effect: ON" script.Parent.BackgroundColor3 = Color3.new(20, 141, 255) end end)
Color3 is a roblox data type. Color3.new() creates a color by taking a percetange, meaning that the three values must be between 0 and 1. I can see that you are trying top change the color using rgb numerical coding. The old method to fixing this was to put the numbers out of 255, so it would look like this:
Color3.new(20/255,141/255,255/255)
This created a number between 0 and 1 and it was used to create desired colors. Nowadays roblox has evolved so now Color3 has a function called fromRGB(). By using this you can create your desired color using rgb numerical coding like so:
Color3.fromRGB(20,141,255)
TL;DR Use Color3.fromRGB()
I hope my answer was helpful
~Lone