local tool = script.Parent
local player = game.Players.LocalPlayer
local character = game.Players.LocalPlayer.Character or player.CharacterAdded:Wait()
local animation
local anim = script.Parent:WaitForChild("Animation"):Clone()
tool.Equipped:Connect(function()
animation =character:WaitForChild("Humanoid"):LoadAnimation(anime)
character = character or tool.Parent or player.Character or player.CharacterAdded:Wait()
if not animation then
animation = character.Humanoid:LoadAnimation(animation)
end
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)
I made a team change script that resets the character, then the animation of the tool is completely broken? how do I fix it?
When I reset this error shows up.

4 comments
I have tried it before, it did not change anything.
'anime' is more than likely your problem here, since you didn't define it?
Changed that, still does not work
I fixed it myself, thanks for answering :D