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

Can someone fix this? [Easy] [Unsolved]

Asked by 9 years ago

Someone fix it please it's suppose to delete the Chosen team colors tools from players. Thanks

TheTeamColor = "Br. yellowish green" 
game.Players.ChildAdded:connect(function(player)
if player.TeamColor == TheTeamColor then
c = player.StarterGear:GetChildren().remove()
for i = 1,#c do
c[i]:Destroy()
end
end
end)

3 answers

Log in to vote
2
Answered by 9 years ago
c = player.StarterGear:GetChildren().remove()

You're trying to call the remove method on a table, which won't work. Try removing the '.remove()' part.

Ad
Log in to vote
0
Answered by
Nymint 85
9 years ago

1- You're removing it from StarterGear, if these aren't your intentions, remove them on Backpack. 2-It's ":remove()", Not ".remove()".

Log in to vote
0
Answered by 9 years ago

Don't forget about :ClearAllChildren()

TheTeamColor = "Br. yellowish green"
game.Players.ChildAdded:connect(function(player)
    if player.TeamColor == TheTeamColor then
        player.StarterGear:ClearAllChildren()
    end
end)

Answer this question