Hi, im trying to make a brick color changer GUI but im getting really confused about what im making right now, so if anyone can help me fix this, it would be really appreciated! Sorry if this is a little messed up :/
local num = 20 --amount of colors
function OnClicked()
local player = script.Parent.Parent.Parent.Parent.Parent
local color = script.Parent.Parent.BackColor --this is where the name of the color should be
local c2 = script.Parent.Parent.BackName
local c1 = game.Lighting.Folder:GetChildren() --this is where i store my colors in string values named color1, color2,color3 etc.
for c1 = 1,3 do --this is where it gets messy
if color.Value == "None" then
color.Value = c1.Value
else
local n = tonumber(c1.Name:match("%d+"))
if n == num then
color.Value = "None"
else
color.Value = c1.Name..(n+1).Value
end
end
end
--(the part under is fine so i dont need to add it here)

1 comment
Rather than asking us what the script does, ask us what's the problem and the solution. Can you explain to us what you're trying to do with this script? We need more info (where the script is located)