I'm trying to add custom emotes into my game, but there are a few bugs with the animations
Heres what happens when you start walking https://gyazo.com/bc9b9112f40d8a38c29366edfc77e1aa (Link doesn't work, so to see the issue you have to copy or paste in your browser, or don't)
Code
local plr = game:GetService('Players').LocalPlayer
local emotes = {
sit = "rbxassetid://withdrawn",
};
function stopAnims()
local Humanoid = game.Players.LocalPlayer.Character.Humanoid
local ActiveTracks = Humanoid:GetPlayingAnimationTracks()
for _,v in pairs(ActiveTracks) do
v:Stop()
end
end
for i,v in pairs(emotes) do
local anim = Instance.new('Animation')
anim.AnimationId = v
emotes[i] = plr.Character.Humanoid:LoadAnimation(anim)
emotes[i].Priority = Enum.AnimationPriority.Core
end
plr.Chatted:connect(function(message)
if message:sub(1,3) == "/e " then
local emote = message:sub(4)
emote = emotes[emote]
if emote then
if not emote.IsPlaying then
stopAnims()
emote:Play()
end
end
end
end)

1 comment
The thing is, canceling the emote would be an issue, and also the way the rounds work, I don't think the player would want to be frozen at the start of the round and be instantly killed.