Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I get an animation to play on a character?

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?

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.