Output comes up with "in 'pairs'(table expected, got nil)" What is wrong? [closed]
Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).
one = {script.Parent.One:GetChildren()}
two = {script.Parent.Two:GetChildren()}
three = {script.Parent.Three:GetChildren()}
four = {script.Parent.Four:GetChildren()}
five = {script.Parent.Five:GetChildren()}
function Blue()
for i,v in pairs(p) do
v.BrickColor = BrickColor.new("Electric blue")
end
end
function Green()
for i,v in pairs(p) do
v.BrickColor = BrickColor.new("Lime green")
end
end
function Yellow()
for i,v in pairs(p) do
v.BrickColor = BrickColor.new("New Yeller")
end
end
function Red()
for i,v in pairs(p) do
v.BrickColor = BrickColor.new("Really red")
end
end
function Black()
for i,v in pairs(p) do
v.BrickColor = BrickColor.new("Black")
end
end
while true do
local p = one
Blue()
wait(0.25)
Green()
wait(0.25)
Yellow()
wait(0.25)
Red()
wait(0.25)
Black()
wait(0.5)
end
while true do
local p = two
Green()
wait(0.25)
Yellow()
wait(0.25)
Red()
wait(0.25)
Black()
wait(0.25)
Blue()
wait(0.5)
end
while true do
local p = three
Yellow()
wait(0.25)
Red()
wait(0.25)
Black()
wait(0.25)
Blue()
wait(0.25)
Green()
wait(0.5)
end
while true do
local p = four
Red()
wait(0.25)
Black()
wait(0.25)
Blue()
wait(0.25)
Green()
wait(0.25)
Yellow()
wait(0.5)
end
while true do
local p = five
Black()()
wait(0.25)
Blue()
wait(0.25)
Green()
wait(0.25)
Yellow()
wait(0.25)
Red()
wait(0.5)
end
Closed as Non-Descriptive by Soban06 and JesseSong
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?