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

How to make punching animation that can play using a key? or a punch tool. that can play by click

Can anyone help me, cause i want to learn how to make animations by using keys. Thanks in advance.

2 answers

✓ Accepted answer

So I wanted the (almost) same thing and I (think I) figured it out so here's the script

local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer

repeat wait() until Player.Character.Humanoid

local Animation = script.Animation
local Track = Player.Character.Humanoid:LoadAnimation(Animation)

UIS.InputBegan:connect(function(key)
   if key.KeyCode == Enum.KeyCode.E then
       Track:Play()
    end
end)

Make the animation of the punch, then take the script and the animation and put them in StarterPlayerScripts

hope it works for ye

6 comments

0

also there where it says If key.KeyCode == Enum.KeyCode.E change the E in KeyCode.E to what ever key you want.

0

Sir Thanks so much. But if i want three animation to play like right punch left punch then kick ? what i need to do?

0

Try making the kick animation in the same animation maybe

0

^^^^^^^^^^ awnsered correcticly

0

Thanks so much.

0

did it work? cuz it didnt for me XD

This is not a request site, you need to have some effort, try learning on how to make animations and how to use the keys on your keyboard in roblox wiki or in youtube

1 comment

0

I know how to make Animation But everytime i do it it doesn't work.

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