Whenever I try to click one it wont play the animation and two in the output it says:
Infinite yield possible. "local AnimationController = AnimGun:WaitForChild("AC")
The script is here:
--Gun is the part of the gun that contains: Handle, Values and Scripts
local Gun = script.Parent
Gun.Equipped:Connect(function(mouse)
--AnimGun is a model because its a Rig, So it can be animated
local AnimGun = Gun:WaitForChild("MovingParts")
--Fake Handle (used in animation)
local FHandle = AnimGun:WaitForChild("FakeHandle")
--Real Handle (Used to hold tool)
local RHandle = Gun:WaitForChild("Handle")
--Make a table of the elements in MovingParts
local guntable = AnimGun:GetChildren()
--Make a weld from Real to Fake handle, parent weld to Real Handle
local HandleWeld = Instance.new("Weld",RHandle)
HandleWeld.Part0 = RHandle
HandleWeld.C0 = RHandle.CFrame:inverse()
HandleWeld.Part1 = FHandle
HandleWeld.C1 = FHandle.CFrame:inverse()
--Animating Part
local AnimationController = AnimGun:WaitForChild("AC") --Equivilent to Humanoid, instead used for animating NPCs
local Animation = Instance.new("Animation")
Animation.AnimationId = "https://www.roblox.com/Asset?ID=2157386862" --Put the animation ID here
local LoadAnimation = AnimationController:LoadAnimation(Animation) --Loads the Animation
print("Loaded the Animation")
mouse.Button1Down:connect(function()
LoadAnimation:Play() --Plays the animation
print("Animation played")
end)
end)
While I have tried adding something like this:
local AnimationController = AnimGun:WaitForChild("AC", 100)
It still doesn't work because the animation doesn't play.

2 comments
There is no child named 'AC' in the AnimGun
Oh right I'm stupid. Thanks.