Help with making a frames color reflect the text in textbooks

local R = script.Parent.Parent.R.Text

local G = script.Parent.Parent.G.Text

local B = script.Parent.Parent.B.Text

local Color = script.Parent.Parent.Color

local Button = script.Parent

Button.MouseButton1Click:Connect(function()

Color.BackgroundColor = Color3.fromRGB(R, G, B)

end)

It does not work. So basically the background color of the frame is suppose to be the text of the textboxes.

local Button = script.Parent
local Frame = Button.Parent
local Color = Frame.Color
local R = Frame.R
local G = Frame.G
local B = Frame.B

Button.MouseButton1Click:Connect(function()
	Color.BackgroundColor3 = Color3.fromRGB(tonumber(R.Text), tonumber(G.Text), tonumber(B.Text))
end)
1 Like

The only thing you’re missing is a 3

should be

Color.BackgroundColor3 = Color3.fromRGB(R, G, B)