How to detect a player when it uses a emote

i want to create an npc that copies every movement of a player
and idk how would i detect and get the emote being played on the player’s humanoid
i tried searching but i find mostly far results

If you want to detect player animations in general(assuming you’re trying to copy player movement) Animator.AnimationPlayed is an event which fires when an AnimationTrack is being player for a specific character:

--Script inside StarterCharacterScripts
local Character = script.Parent 
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")

Animator.AnimationPlayed:Connect(function(animationTrack)
	local AnimObject = animationTrack.Animation 
	print(AnimObject.AnimationId)
end)

and to get already running animationTracks:

local AnimationTracks = Animator:GetPlayingAnimationTracks() 
for _, animationTrack in pairs(AnimationTracks) do
	local AnimObject = animationTrack.Animation 
	print(AnimObject.AnimationId)
end
3 Likes