I made a script to replace the roblox custom R15 animations when the tool is equipped and it makes it the original R15 animations. But I get this error in the output: "Infinite yield possible on 'Players.oshawat00.Backpack.DB Shotty.Animatue:WaitForChild("Humanoid")'
I don't know why and I don't even have WaitForChild("Humanoid") in the script I was wondering if anyone could help me fix this and I'm not asking for a complete remake of the script. My player does have a humanoid but I don't know why the script isn't working. Here is the script:
wait()
local e = script.Parent.Equipped
local u = script.Parent.Unequipped
local re = false
if e then
local anime = game.Players.LocalPlayer.Character:WaitForChild("Animate")
if anime then
local Original = game.Players.LocalPlayer.Character.Animate:Clone()
Original.Parent = script
game.Players.LocalPlayer.Character.Animate:Destroy()
wait()
local new = game.ReplicatedStorage.Animate:Clone()
new.Parent = game.Players.LocalPlayer.Character
r = false
end
if u then
re = true
if re then
local Origin = script.Animate
game.Players.LocalPlayer.Character.Animate:Destroy()
wait()
Origin.Parent = game.Players.LocalPlayer.Character
end
end
end
Thank you.

4 comments
There is no :WaitForChild("Humanoid") in this script, so this cannot be the problem.
I dont know why then
Does the script work though? If it works, don't mind it, sometimes if a WaitForChild takes too long, the compiler thinks there's no such child.
No it dont work. Sadly.