Hi guys how are you, im making an emote ui but when i try to play the animation it doesnt work and no error appears.
here is the code:
local Character = LocalPlayer.Character or ( LocalPlayer.CharacterAdded:Wait() and LocalPlayer.Character );
local Humanoid = Character:WaitForChild("Humanoid") :: Humanoid;
local Animation = Instance.new("Animation");
Animation.AnimationId = "rbxassetid://"..v -- Dance Id;
Animation.Name = k -- Dance Name;
local AnimationTrack = Humanoid:LoadAnimation(Animation);
AnimationTrack.Priority = Enum.AnimationPriority.Action
AnimationTrack:Play();
local Character = LocalPlayer.Character or ( LocalPlayer.CharacterAdded:Wait() and LocalPlayer.Character );
local Humanoid = Character:WaitForChild("Humanoid") :: Humanoid
local Animator = Humanoid:WaitForChild(“Animator”)
local Animation = Instance.new("Animation");
Animation.AnimationId = "rbxassetid://"..v -- Dance Id;
Animation.Name = k -- Dance Name;
local AnimationTrack =Animator:LoadAnimation(Animation);
AnimationTrack.Priority = Enum.AnimationPriority.Action
AnimationTrack:Play();
local players = game:GetService("Players")
local LocalPlayer = players.LocalPlayer
local v = 000000000
local k = "Dance Name"
local Character = LocalPlayer.Character or ( LocalPlayer.CharacterAdded:Wait() and LocalPlayer.Character );
local Humanoid = Character:WaitForChild("Humanoid") :: Humanoid;
function activated()
local Animation = Instance.new("Animation");
Animation.AnimationId = "rbxassetid://"..v -- Dance Id;
Animation.Name = k -- Dance Name;
local AnimationTrack = Humanoid:LoadAnimation(Animation);
AnimationTrack.Priority = Enum.AnimationPriority.Action
AnimationTrack:Play();
print("Play")
end
script.Parent.Activated:Connect(activated)
It works, (at least for me). The problem isn’t this part of the code, it’s whatever you’re doing to call it.
This is not true. Infact, it might even be worse to use them on a client. Using them on a server is more efficient and will let everybody see what animations you play.
Yeah, I think that’s because it was made before the FilteringEnabled updates. They made it work even though it’s on a client and wouldn’t show to other players.
Honestly I don’t know, I’ve had instances where it’s shown for all on client but also not. You’re probably right in that it’s better to fire the server and run it there.
Ah, alright. We’ll just put my code in a local script in a tool (make sure to add a handle or turn of RequireHandle in the properties), replace the animationID and it should work.