Hello So I have this script in my game. It is for a gui but it gives me this error: RobloxTeam is not a valid member of Model
Here is the script
print("Removing default objects.");
local GUI = script.Parent.Parent;
local player = GUI.Parent.Parent;
local user = player.Character;
repeat wait(1/30) until player.PlayerGui:findFirstChild("HealthGUI");
player.PlayerGui.HealthGUI:remove();
player.Backpack.ChildAdded:connect(function(child)
wait();
if child.Name ~= "developerObject" and child.Name ~= "" and child.Name ~= "SELECT" and child.Name ~= "spin" then
child:remove();
end
end)
for index, child in pairs (player.Backpack:getChildren()) do
if child.Name ~= "developerObject" and child.Name ~= "" and child.Name ~= "SELECT" and child.Name ~= "spin" then
child:remove();
end
end
user.ChildAdded:connect(function(child)
wait();
if child.Name ~= "developerObject" and child.Name ~= "" and child.Name ~= "SELECT" and child.Name ~= "spin" then
child:remove();
end
end)
for index, child in pairs (user:getChildren()) do
if child.Name ~= "developerObject" and child.Name ~= "" and child.Name ~= "SELECT" and child.Name ~= "spin" and (child:isA("CharacterMesh") or child:isA("Tool") or child:isA("HopperBin") or child:isA("Hat") or child:isA("Shirt") or child:isA("Pants") or child:isA("ForceField") or child:isA("ShirtGraphic") or child:isA("BodyColors")) then
child:remove();
end
end
user.Animate:remove();
for index, child in pairs (user.Head:getChildren()) do
if child.Name ~= "Mesh" then
child:Destroy();
end
end
user.Head.ChildAdded:connect(function(child)
wait();
if child.Name ~= "Mesh" and child.Name ~= "dead" then
child:Destroy();
end
end)
user.Torso.ChildAdded:connect(function(child)
wait();
if child.Name == "roblox" then
child:Destroy();
end
end)
user.Torso.roblox:remove();
user.RobloxTeam:remove(); -- THIS IS THE PART WHERE THE ERROR OCCURS
user.Sound:remove();
user.Health:remove();
user["HealthScript v3.1"]:remove();
I'm hoping that someone could help me fix this.

4 comments
Don't just post the whole script, post the bit which causes the error...
you can't remove a Team from the player
eww stop using bad practicies
user.RobloxTeam:remove();:face_palm:RobloxTeam's aren't a thing anymore.