I created an animation (that is on the ROBLOX site now, I had to pay 30 R$) that I would like to play when a player presses the W or UP arrow key on the keyboard, but I do not know how to do this.
Any help?
Thank you!
local animation = Instance.new("Animation") animation.AnimationId = "animation ID" -- ex http.robloxblahblah local animTrack = Humanoid:LoadAnimation(animation) function onKeyDown(key) key = key:lower() if key == "w" then -- i dont know how to do it for the up key, sorry animTrack:Play() end end script.Parent.Parent:GetMouse().KeyDown:connect(onKeyDown)
make sure it is in a local script, in the player's backpack