I have made a light pattern script for a neon sign in the game, but it’s really overcomplicated and I want to know how I can shorten it down.
robloxapp-20230625-1919162.wmv (255.4 KB)
local l1 = script.Parent.Parent.L1;
local l2 = script.Parent.Parent.L2;
local l3 = script.Parent.Parent.L3;
local l4 = script.Parent.Parent.L4;
local l5 = script.Parent.Parent.L5;
local l6 = script.Parent.Parent.L6;
while true do
l1.BrickColor = BrickColor.new("Steel blue");
l2.BrickColor = BrickColor.new("Steel blue");
l3.BrickColor = BrickColor.new("Steel blue");
l4.BrickColor = BrickColor.new("Steel blue");
l5.BrickColor = BrickColor.new("Steel blue");
l6.BrickColor = BrickColor.new("Steel blue");
wait(0.5);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.5);
l1.BrickColor = BrickColor.new("Steel blue");
l2.BrickColor = BrickColor.new("Steel blue");
l3.BrickColor = BrickColor.new("Steel blue");
l4.BrickColor = BrickColor.new("Steel blue");
l5.BrickColor = BrickColor.new("Steel blue");
l6.BrickColor = BrickColor.new("Steel blue");
wait(0.5);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.5);
--2
l1.BrickColor = BrickColor.new("Steel blue");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Steel blue");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Steel blue");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Steel blue");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Steel blue");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Steel blue");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Steel blue");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Steel blue");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Steel blue");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Steel blue");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Steel blue");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
--3
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Steel blue");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Steel blue");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Steel blue");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Steel blue");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Steel blue");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Steel blue");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Steel blue");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Steel blue");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
l2.BrickColor = BrickColor.new("Steel blue");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Steel blue");
l2.BrickColor = BrickColor.new("Black");
l3.BrickColor = BrickColor.new("Black");
l4.BrickColor = BrickColor.new("Black");
l5.BrickColor = BrickColor.new("Black");
l6.BrickColor = BrickColor.new("Black");
wait(0.05);
l1.BrickColor = BrickColor.new("Black");
wait(0.5);
end;
Cheers