I want it to delete all the other accessories that they have and replace it with a different one.
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(Char)
local Folder = script:FindFirstChild(p.Team.Name)
if Folder then
--TOOLS
local Tools = Folder:FindFirstChild("Tools")
if Tools then
--Goes through tools
for i,v in pairs(Tools:GetChildren()) do
--Makes a copy of the tool and puts it in user's inventory
v:Clone().Parent = p.Backpack
end
end
--CLOTHES
--Checks if class has clothes
local Clothes = Folder:FindFirstChild("Clothes")
if Clothes then
--Goes through clothes
for i,v in pairs(Clothes:GetChildren()) do
local Clothing = Char:FindFirstChild(v.Name)
if Clothing then
Clothing:Destroy()
end
v:Clone().Parent = Char
end
end
--HATS?
local Hats = Folder:FindFirstChild("Hats")
end
end)
end)
Character = script.Parent
Humanoid = Character.Humanoid
Torso = Character.Torso
