The error "attempt to call a userdata value" is happening in the Animation2:Play() line. I can't find any reason for that to occur, so could you help me?
local Animation2 = Player.Character.Humanoid:LoadAnimation(game.ServerStorage.Objects.Animations.Failed)
Animation2:Play()
That error begun to appear not too much time ago and before that the script was running as usual, also I haven't edited script around that time I think. Animations from other parts of the code are loading normally though.
Edit: I forgot to mention that the script isn't even running that part of the code but still gives the error.
Fixed: It was the New Lua VM (Beta Feature) :|

5 comments
Is this a server script? If not then, You can’t access items from server storage. Also, do all animations on the client side as it replicates and it’s a better practice.
Yeah, it is a server script. About the animations, I didn't know they were replicated in the client so I made all of mine be loaded and played in the server script.
Doing animations client-sided is an absolutely terrible idea. Do them on the server.
poke, i came here to tell you that you're bad. one: you should only play animations on the client if they don't need to replicate. two: you should only do anything on the client when they don't need to replicate. three: not entirely incorrect, you can still access serverstorage but it will appear empty for the player (and you can insert stuff in there, too!)
Thanks for all the hints, but I think this error might be unsolveable since yet no one has responded. But I appreciate if anyone continues trying to find an answer, and I'll regularly check this post.