Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Qiuor 20
7 years ago

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?

Closed as Not Constructive by Perci1

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 7 years ago

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)
Ad
Log in to vote
0
Answered by
shayner32 478 Trusted Moderation Voter
7 years ago

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.