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)