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

How do people make animations play with the "Keydown" event?

Asked by 10 years ago

Can somebody help me, I don't know how to use the keydown event, and I'd like someone to explain to me how to do it and make animations, and If you're nice enough you'll also tell me about velocity as in body objects.

1 answer

Log in to vote
1
Answered by
ImageLabel 1541 Moderation Voter
10 years ago

KeyDown and Animation

User = game.Players.Estomac
UserMouse = User:GetMouse()

Animation = Instance.new("Animation")
Animation.AnimationId = "http://www.roblox.com/Asset?ID=0"  -- Animation's id
Animation.Name = "Name"
animTrack = User.Character.Humanoid:LoadAnimation(Animation)

UserMouse.KeyDown:connect(function(key) -- keydown function
    if key == "p" then 
    animTrack:Play()
    end
end)
1
How would you make that accessable for everyone, instead of 1 person? TheReapersComing 0 — 10y
1
LocalPlayer ImageLabel 1541 — 10y
Ad

Answer this question