What is the issue?
The old clothing of the player’s character doesn’t get destroyed.
What solutions have you tried so far?
I tried parenting the old clothing to e.x: ReplicatedFirst, but also didn’t work.
The script below is located in ServerScriptService.
local RS = game.ReplicatedStorage
local Pants = RS.Pants
local Shirt = RS.Shirt
game.Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(function(char)
--
local oldpants = char:FindFirstChild("Pants")
local oldshirt = char:FindFirstChild("Shirt")
--
if oldpants then
oldpants:Destroy()
end
--
if oldshirt then
oldshirt:Destroy()
end
--
local CloneShirt = Shirt:Clone()
local PantsClone = Pants:Clone()
--
CloneShirt.Parent = char
PantsClone.Parent = char
--
end)
end)