Animations only working in roblox studio?

So when I play my animations in Roblox studio they seem to work but when I go in the game from the website the animations don’t play does anybody know why? Here’s one of the scripts

script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
anim:Play()
end)

Did you make sure the avatars the correct type? As in your not using an R6 animation on an R15 avatar or vice versa?

Humanoid:LoadAnimation() is deprecated. Use Animator to load the animation instead.

If this is in team create then you would have to publish the animation, otherwise I do not know why this would not work.

I’m sorry do you mind me asking what animator is?

Animator is the instance of a Humanoid, it controls the playback of animation. Humanoid was deprecated for loading animation due to creating multiple animators for odd reasons in the backend.