So I'm working on a tool that whenever its activated plays a animation then puts on the clothes, however It appears to remove the clothes and play the animation, however doesn't appear to add the clothes
script:
local tool = script.Parent
local Animation = tool.Animation
local Woosh = tool.Woosh
tool.Activated:Connect(function()
Woosh:Play()
local Character = tool.Parent
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
wait(1)
local AttachSound = Instance.new("Sound")
local char = tool.Parent:FindFirstChild("Humanoid")
local Model = char.Parent
local Shirt = Instance.new("Shirt")
local Pants = Instance.new("Pants")
if char.Parent:FindFirstChild("Shirt") and char.Parent:FindFirstChild("Pants") then
char.Parent:FindFirstChild("Shirt"):Destroy()
char.Parent:FindFirstChild("Pants"):Destroy()
end
AttachSound.Parent = Model
AttachSound.Volume = 10
AttachSound.SoundId = "rbxassetid://12221967"
AttachSound.Looped = false
AttachSound:Play()
char.WalkSpeed = 20
char.MaxHealth = 150
char.Health = 150
Shirt.Parent = Model
Shirt.ShirtTemplate = "https://web.roblox.com/catalog/8878853958/Async-Hazmat-Suit-Shirt-The-Backrooms"
Pants.Parent = Model
Pants.PantsTemplate = "https://web.roblox.com/catalog/9575156100/Black-Shoes-Async-Hazmat-Suit-The-Backrooms"
tool:Destroy()
game:GetService("Debris"):AddItem(AttachSound,0.5)
end)
