The item in studio, the animation object, I know how to make it into an animation just not how to make it play when a player hits a certain key, for instance r. Any solutions?
✓ ANSWER ACCEPTED
How would I get an animation to play on a character?
2 answers
✓ Accepted answer
You can change the key if you want. Remeber to put the code in the local script and the local script into StarterPack
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(Key)
if Key == "r" then
local Anim = Instance.new("Animation")
Anim.AnimationId = "http://www.roblox.com/asset/?id=ANIMATION U WANT"
local AnimLoad = Player.Character.Humanoid:LoadAnimation(Anim)
AnimLoad:Play()
end
end)
Keep in mind that ScriptingHelpers is not a request site. An answer to this question can be found by simply looking at the Animation page on the ROBLOX wiki.
This discussion is preserved as it was. New answers, comments, and votes are closed.
