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

Color3.new with RGB not working? [SOLVED]

This little bit of code was to change the color when clicked, Whats wrong with it?

HomeB = script.Parent.HomeB
SettingsB = script.Parent.SettingsB
HomeB.MouseButton1Down:connect(function()
	HomeB.BackgroundColor3 = Color3.new(R/244, G/244, B/244)
	HomeB.TextColor3 = Color3.new(R/58, G/95, B/176)
end)

1 answer

With your script, you're using RGB as variables. I think you want them to define a certain value for Color3. Color3 is already in RGB format, all you need to do is take the values, and divide them by 255. So it should be like the edited script below;

HomeB = script.Parent.HomeB
SettingsB = script.Parent.SettingsB
HomeB.MouseButton1Down:connect(function()
    HomeB.BackgroundColor3 = Color3.new(244/255, 244/255, 244/255)
    HomeB.TextColor3 = Color3.new(58/255, 95/255, 176/255)
end)

1 comment

0

Wow! Thanks c:

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