Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Not a valid member of part problem?

Asked by 5 years ago
Edited 5 years ago

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.

0
Don't just post the whole script, post the bit which causes the error... TheMightyScript 46 — 5y
0
you can't remove a Team from the player DeceptiveCaster 3761 — 5y
0
eww stop using bad practicies LoganboyInCO 150 — 5y
0
`user.RobloxTeam:remove();` :face_palm: `RobloxTeam`'s aren't a thing anymore. TheeDeathCaster 2368 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question