Player Emote Detection

Just as the title states how could I detect if a player uses the emote menu to start emoting or just emotes using the /e command

1 Like

Not sure if there’s a better way, but there is GetEmotes() as well as AnimationPlayed. Combine these two and you can:

Step 1. Detect when an animation plays
Step 2. Check if that animation is one of the emotes that are returned from :GetEmotes()
Step 3. Run your code.

-- Services
local Players = game:GetService("Players")
-- Player
local player = Players.LocalPlayer
-- Character
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local HumanoidDescription = humanoid:WaitForChild("HumanoidDescription")
-- Script
Humanoid.AnimationPlayed:Connect(function(animationTrack)
  if HumanoidDescription:GetEmotes()[animationTrack.Name] then
    -- An emote is playing!
  end
end

Not entirely sure if this works, but it makes sense to me, you can try it out in a local script.

2 Likes

Apologies for the necropost, but this is the top result for detecting emotes on Google, so I thought I’d share:

HumanoidDescription:GetEmotes() returns an array of tables that just contain Asset IDs of emotes, not names or Animation IDs (which would have been very useful :pensive:).

Instead, I resorted to doing a process of elimination to determine if a player is emoting or not, which I have posted as a community resource linked below:

I recommend altering this code to cater to yall’s specific use case.

1 Like