How do I delete an animation after it's played?
I am trying to delete the animation at the end when it gets stopped, but I am having trouble with that, I've tried
Instance:Remove
with a few variations but each has fed me an error.
01 | local player = game.Players.LocalPlayer |
02 | local Character = player.Character or player.CharacterAdded:Wait() |
03 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
04 | local Script = Character:WaitForChild( "Animate" ) |
07 | script.Parent.MouseButton 1 Click:Connect( function (clicked) |
10 | player.Character.Animate.Disabled = true |
11 | local Animation = Instance.new( "Animation" ) |
13 | Animation.Parent = player.Character |
14 | Animate = Humanoid:LoadAnimation(Animation) |
19 | player.Character.Animate.Disabled = false |