SuitUp.OnServerEvent:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Player.Character:FindFirstChild("Humanoid")
for _,v in pairs(Character:GetChildren()) do
if v:IsA("Accessory") and not v.Handle:FindFirstChild("HairAttachment")then
v.Handle.Transparency = 1
end
end
Character.Shirt:Destroy()
Character.Pants:Destroy()
Top.Parent = Character
Bottom.Parent = Character
end)
SuitDown.OnServerEvent:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
for _,v in pairs(Character:GetChildren()) do
if v:IsA("Accessory")then
v.Handle.Transparency = 0
end
end
Top.Parent = AntManSuit
Bottom.Parent = AntManSuit
ReplicatedStorage:WaitForChild("DefaultClothing").Shirt.Parent = Character
ReplicatedStorage:WaitForChild("DefaultClothing").Pants.Parent = Character
end)
I’m making a script that changes your character’s outfit when activated once, and back to default clothes when activated a second time with the suitdown function. However because I destroyed the original clothes in the suit up function which becomes the backup default outfits I have in the defaultclothing folder the second round, when I run the suit up for the second time the original clothes will no longer exist.
How do I make it so that when the suit up function is ran for the second time, instead of destroying the outfit, it sends the clothes back to the defaultclothing folder? Do I use coroutines? Spawn?