local plr = game.Players.LocalPlayer local chr = plr.Character or plr.CharacterAdded:Wait() local hum = chr:FindFirstChild("Humanoid") game:GetService('UserInputService').InputBegan:Connect(function(input) print("test") if input.KeyCode == Enum.KeyCode.E and plr and chr then local emote = script.Animation emote.AnimationId = "rbxassetid://1977787384" local animloader = hum:LoadAnimation(emote) animloader:Play() end end)
That is the script. What is wrong?
When it comes to animation, there are a few things you must know.
You must OWN the animation. This means you have exported it.
Make sure the animation's PRIORITY is set to ACTION this will guarantee it to overlap Roblox's Default animations with some exceptions.
Make sure you actually have the animation as an object.
Make sure when you do
:LoadAnimation()
it's being done on a Humanoid
Alright now that you know this and confirmed it here is your fixed script:
local plr = game.Players.LocalPlayer local chr = plr.Character or plr.CharacterAdded:Wait() local hum = chr:FindFirstChild("Humanoid") local UIS = game:GetService('UserInputService') UIS.InputBegan:Connect(function(input, IsTyping) if IsTyping then return end print("test") if input.KeyCode == Enum.KeyCode.E and chr then local emote = Instance.new('Animation') emote.AnimationId = "rbxassetid://1977787384" local LoadAnimation= hum:LoadAnimation(emote) LoadAnimation:Play() wait(3) emote:Destroy() end end)
This should work if you happen to find a bug or error comment below. Anyway, I hope I helped.
Here is some information on Animations: http://wiki.roblox.com/index.php?title=Animations
Best of luck to you and hope it's fixed!