This is what I have tried
script.Parent.Parent.Chatted:connect(function(msg) if msg == "test" then local children = game.Workspace.Tree:GetChildren() for i = 1, #children do i, children.BrickColor = BrickColor.new("Brown") end end end)
No script error shows up in the output
script.Parent.Parent.Chatted:connect(function(msg) --I will assume you have this script in backpack. if msg == "test" then local children = game.Workspace.Tree:GetChildren() for i = 1, #children do children[i].BrickColor = BrickColor.new("Brown") --You can't have i, children, this part of the script would break. You can do children[i] because "i" is the index number or table name for the item in "children". Other than this line, you script seems fine. end end end)