Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

:Destroy() is confused on behavior? closed

Asked by 4 years ago
Edited 4 years ago

Hello. I am trying to delete the animation of a player. It currently errors out with attempt to index nil with destroy.

Character = game.Players.iiDkOffical.Character
Character:FindFirstChild("Animate"):Destroy()
animtracks = PHumanoid:GetPlayingAnimationTracks()
for i, v in pairs(animtracks) do
    v:Stop()
    v:Remove()
end

1 answer

Log in to vote
0
Answered by 4 years ago

figured it out in the easiest way

Character.Animate:Destroy()
animtracks = PHumanoid:GetPlayingAnimationTracks()
for i, v in pairs(animtracks) do
    v:Stop()
    v:Remove()
end
Ad

Answer this question