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
You should use GetPropertyChangedSignal to detect when the Torso colour changes:
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) char:WaitForChild("Torso"):GetPropertyChangedSignal("BrickColor"):Connect(function() print(tostring(char.Torso.BrickColor) .. ": " .. plr.Name) end) end) end)
Well R15 doesn't have a Torso so that could be the problem. You can use UpperTorso and LowerTorso instead