Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Not a valid member of part problem?

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

0

Don't just post the whole script, post the bit which causes the error...

0

you can't remove a Team from the player

0

eww stop using bad practicies

0

user.RobloxTeam:remove(); :face_palm: RobloxTeam's aren't a thing anymore.

1 answer

✓ Accepted answer

It just means, that there's no such thing as RobloxTeam in your character. Try removing it ans see what happens.

This discussion is preserved as it was. New answers, comments, and votes are closed.