Playing user emotes on rigs?

Hi!

I am not sure if this is even possible, but I want to try it anyways. I have a rig that is R15, and I want to play emotes on. I pulled the humanoid description from my player, and parented it to the humanoid. This is a rig in workspace, so I converted the default Roblox animate script into a server side script by removing the chat emote hook system, and porting all the code and parts into a server script like so:
{22096D10-7BFF-4F57-B3F5-4B42F84BA507}

(This was not required but I feel it is important to mention anyways.)

Then, I load and try playing random emotes from the HumanoidDescription with this:

local humanoidDescription = humanoid:FindFirstChildOfClass("HumanoidDescription")
local emotes = humanoidDescription:GetEmotes()
if humanoidDescription then
	local emoteKeys = {}
	for key, _ in pairs(emotes) do
		table.insert(emoteKeys, key)
	end

	local count = #emoteKeys
	if count > 0 then
		local randomEmoteKey = emoteKeys[math.random(1, count)]		
		humanoid:PlayEmote(randomEmoteKey)
	end
end

Since an emote table is returned with the emote name as the table index, I peel the emote name data off and then calling humanoid:PlayEmote() takes a random name as the input.

However, doing so causes this error:
{6E95A096-7D4A-4397-A60B-97BBF0E5BDEF}

So I tried passing the humanoid and emote name to the client via a RemoteBindableEvent and having the client play it, but now I get this error:
{74E12C04-B9F3-4E19-BB92-ACE59F67FCDF}

So now the question is, how do I play the emotes on a rig?

When I load the emote onto an animation track directly with the asset ID pulled from the emote returned from the humanoidDescription:GetEmotes(), I get an error similar to what is found when loading an animation track not owned by you / a group, even though the animation is by Roblox themselves.

Am I doing something wrong? What can I do to play Roblox emotes on a rig in workspace?

(P.S yes, my rig is R15)

Do you want to only allow those pre assigned emotes (/e dance, /e wave, /e cheer, etc) or do you want to also include the marketplace emotes?

Both, but I am primarily after Marketplace emotes.

You can probably use InsertService to load the animation asset from the marketplace, so you’ll be able to copy the AnimationId from there.

1 Like

Much thanks!!! This did exactly what I needed it to :3

local humanoidDescription = humanoid:FindFirstChildOfClass("HumanoidDescription")

local emotes = humanoidDescription:GetEmotes()

if humanoidDescription then
	local emoteKeys = {}
	for key, _ in pairs(emotes) do
		table.insert(emoteKeys, key)
	end

	local count = #emoteKeys
	if count > 0 then
		local randomEmoteKey = emoteKeys[math.random(1, count)]			
		local a = game:GetService('InsertService'):LoadAsset(emotes[randomEmoteKey][1])
		
		local animationTrack = animationController:LoadAnimation(a:GetChildren()[1])
		animationTrack:Play()
	end
end

If you want to load any that the player has equipped, start a play test in studio and copy the Animate script in the default roblox character and save it on the server somewhere. Then on your custom rig, before parenting it to the workspace you need to clone the animate script that you saved into the rig. And then you should be able to press . to bring up the emote radial wheel and play your equipped emotes

image

This won’t work— As I explained, my rig is in the workspace and is not a player model, so the animate localscript won’t work unless it is a server script, which is why I converted it to one.

The animate script was never the issue, just how I was loading the emotes. I have a solution already, but I appreciate the input!

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