How would i get the code to know i want the property and not a child?
My goal is to have a custom color button and also preset colors so players dont need to type in rgb everytime they want something.
output error:
21:25:34 BackroundColor3 is not a valid member of TextButtonPlayers.Gamerdude7820.PlayerGui.MainGui.Main.Prompts.lightchange.Colors.buttoncolor
for i,v in pairs(cgroup:GetChildren()) do
if v.Name == "buttoncolor" then
v.MouseButton1Click:Connect(function()
--the purpose of these prints is to make sure i am getting the correct rgb values.
print(v.BackroundColor3.R)
print(v.BackroundColor3.G)
print(v.BackroundColor3.B)
end)
end
end
for i,v in pairs(cgroup:GetChildren()) do
if v.Name == "buttoncolor" then
v.MouseButton1Click:Connect(function()
--the purpose of these prints is to make sure i am getting the correct rgb values.
print(v.BackgroundColor3.R * 255)
print(v.BackgroundColor3.G * 255)
print(v.BackgroundColor3.B * 255)
end)
end
end
for i,v in pairs(cgroup:GetChildren()) do
if v.Name == "buttoncolor" then
v.MouseButton1Click:Connect(function()
--the purpose of these prints is to make sure i am getting the correct rgb values.
local Red = v.BackgroundColor3.R * 255
local Green = v.BackgroundColor3.G * 255
local Blue = v.BackgroundColor.B * 255
print(math.round(Red))
print(math.round(Green))
print(math.round(Blue))
end)
end
end
So, this system is a premium perk that changes the light colors in my game, but i am trying to clean it up so people that do not know what rgb means, will be able to tap the colorful buttons.
Heres an explanation:
Button clicked
Submit clicked
Script checks
Server Changes light colors