Why am i getting an error while trying to play animations?s

Animations aren’t playing, I’m getting an error:
image
I’m not sure why I’m getting this, everything is labeled correctly.
image
image

1 Like

image
I would guess this is the line causing the error. If there are no playing tracks, then v will be nil; On the next line when you try to index it with Animation, it will throw an error.

A fix would be to check if there are any animations playing before trying to loop through them.

Fix
local playingTracks = Character.Humanoid.Animator:GetPlayingAnimationTracks() -- Gets playing tracks
if #playingTracks > 0 then -- If the number of playing tracks is greater than 0
	for i, v in pairs(playingTracks) do -- Loops through playing tracks
		...

I’m getting an error on line 32, so it’s on “info.Animation”, and idk why it would do that since everything is named correctly

The error tells you that info is nil, and you are doing nil.Animation. In the script you defined info as all extra arguments added, and if info is nil (suggested by the error), then you didn’t pass any extra arguments or the first one of those arguments is nil.
This is probably an error from the local script that is handling OnClientEvent, can you show that script here? Try printing what info is on the module and check if it returns nil.

Your words just cleared everything up and i was able to fix it, thank you :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.