No animations after deleting and putting back the humanoid

Ok, So I’m trying to refresh the humanoid by cloning it, deleting it and putting it back into the character, however whenever I do that it automatically made it so no animations work and the character moves around in a frozen state.
I’ve tried numerous things such as:
*Cloning the animation script, removing it and placing it back once I’ve placed back the humanoid
*Making the animation script disabled then enabling it once I’ve placed back the humanoid.

Here are the lines for more information :happy3:

local cloned_hum = plr.Character.Humanoid:Clone()
plr.Character.Humanoid:Destroy()
wait(0.1)
cloned_hum.Parent = plr.Character

forgot to mention this but nothing I’ve tried has worked so far!

Maybe remove the wait(0.1).
Also, why are you refreshing the Humanoid?
I can’t think of a reason to.

well I’m actually refreshing the player’s humanoid because of a glitch that is solved by doing so.

I see the problem in your script

There should be no delay (Don’t use wait()) and the Animate script is now referencing a Humanoid that no longer exists.

Your code should be this:

local cloned_hum = plr.Character.Humanoid:Clone()

plr.Character.Humanoid:Destroy()
cloned_hum.Parent = plr.Character
local cloned_animate = plr.Character.Animate:Clone()
plr.Character.Animate:Destroy()
cloned_animate.Parent= plr.Character