local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character local Humanoid = Character and Character:FindFirstChild("Humanoid") if not Humanoid then warn("Humanoid not found!") return end -- Function to detect the currently playing animation local function getCurrentAnimation() local animator if Character:FindFirstChildOfClass("Humanoid") then if Humanoid.RigType == Enum.HumanoidRigType.R6 then animator = Humanoid:FindFirstChild("Animator") elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then animator = Humanoid:FindFirstChildOfClass("Animator") end end if animator then for _, animationTrack in pairs(animator:GetPlayingAnimationTracks()) do if animationTrack.IsPlaying then return animationTrack.Animation.AnimationId end end end return nil end local function monitorAnimation() local animator if Character:FindFirstChildOfClass("Humanoid") then if Humanoid.RigType == Enum.HumanoidRigType.R6 then animator = Humanoid:FindFirstChild("Animator") elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then animator = Humanoid:FindFirstChildOfClass("Animator") end end if animator then animator.AnimationPlayed:Connect(function(animationTrack) print("Animation played:", animationTrack.Animation.AnimationId) end) animator.AnimationStopped:Connect(function(animationTrack) print("Animation stopped:", animationTrack.Animation.AnimationId) end) else warn("Animator not found for this rig type.") end end local animationID = getCurrentAnimation() if animationID then print("Currently playing animation:", animationID) else print("No animation detected!") end monitorAnimation()