I feel as if there is a better way of wrong this code but making it in a shorter amount of lines. Any way?
home.MouseButton1Click:Connect(function()
home.BackgroundColor3 = selectedColor
for i,v in pairs(buttons) do
if v ~= home then
v.BackgroundColor3 = otherColor
end
end
end)
goRace.MouseButton1Click:Connect(function()
goRace.BackgroundColor3 = selectedColor
for i,v in pairs(buttons) do
if v ~= goRace then
v.BackgroundColor3 = otherColor
end
end
end)
cars.MouseButton1Click:Connect(function()
cars.BackgroundColor3 = selectedColor
for i,v in pairs(buttons) do
if v ~= cars then
v.BackgroundColor3 = otherColor
end
end
end)
tune.MouseButton1Click:Connect(function()
tune.BackgroundColor3 = selectedColor
for i,v in pairs(buttons) do
if v ~= tune then
v.BackgroundColor3 = otherColor
end
end
end)
customize.MouseButton1Click:Connect(function()
customize.BackgroundColor3 = selectedColor
for i,v in pairs(buttons) do
if v ~= customize then
v.BackgroundColor3 = otherColor
end
end
end)
options.MouseButton1Click:Connect(function()
options.BackgroundColor3 = selectedColor
for i,v in pairs(buttons) do
if v ~= options then
v.BackgroundColor3 = otherColor
end
end
end)

2 comments
http://wiki.roblox.com/index.php?title=Generic_for , http://wiki.roblox.com/index.php?title=Function
I would have a loop connecting all the buttons, then when any are clicked it calls the function, repeating those 6 lines. Should not take over 15 lines total