I'm making a game, and the gun I've made works fine, however, the reload animation is the only thing that doesn't work. Does anybody know how I can fix this?
Here is the script to play the reload animation, there are variables for the reloadTrack and reloadAnim, and in the handle of the gun, there's a sound named 'Reload':
tool.reload_sound:Connect(function()
if reload_sound:Playing() then
reloadtrack = script.Parent.Parent.Humanoid:LoadAnimation(reloadAnim)
reloadtrack.Priority = Enum.AnimationPriority.Action
reloadtrack.Looped = false
reloadtrack:Play()
else
return
end
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
end
end)

5 comments
Try some tests with prints and see where the function stops and maybe make adjustments or give us further animation
It stopped just after the first line.
Any errors?
There aren't any errors, which really confuses me. I have updated my script in the game, too:
I have just updated the post's script, so you can see it.