this script checks every second for the torso color then prints their name with it
it works for some seconds but then it stops and gives me error at one of the lines 6, 11, 16
function func()
for _,v in pairs(game.Players:GetChildren()) do
if v.Character:WaitForChild("Torso").BrickColor == BrickColor.new("Bright green") then -- attempt to index a nil value
print("Bright green: "..v.Name)
end
if v.Character:WaitForChild("Torso").BrickColor == BrickColor.new("Flint") then -- attempt to index a nil value
print("Flint: "..v.Name)
end
if v.Character:WaitForChild("Torso").BrickColor == BrickColor.new("New Yeller") then -- attempt to index a nil value
print("New Yeller: "..v.Name)
end
end
end
while wait(1) do
func()
end

1 comment
also, for convenience, if something is not what your if statement wants, do elseif.