I want them to have to wait for the animation to end before being able to repeat it, I don't want to use a wait statement as players can change which animation/emote they are doing and they have different lengths.
local function onDabUp(player) local Character = player.Character local Humanoid = Character:WaitForChild("Humanoid") local Animation = Character.Animation local Track = Humanoid:LoadAnimation(Animation) if not Track.IsPlaying then Track:Play() else end end
In this function, you loaded the animation everytime it was executed. That means, everytime you execute the function, a new AnimationTrack would be created and it will be like another animation on its own, so even if you checked if it’s playing or not, it will always be false since it have no relation with the AnimationTrack that was created before which is probably playing. What you want to do here is to load the animation once, by moving the line that you defined the AnimationTrack (local Track ...) outside of the function. Also remember to use different variable names if you have multiple animations in one script.
Hope this helps.