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

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

Asked by 7 years ago
Edited 7 years ago

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

2 answers

Log in to vote
0
Answered by 7 years ago

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

0
also there where it says If key.KeyCode == Enum.KeyCode.E change the E in KeyCode.E to what ever key you want. SwagnLag -2 — 7y
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? OniSanYamate -17 — 7y
0
Try making the kick animation in the same animation maybe saSlol2436 716 — 7y
0
^^^^^^^^^^ awnsered correcticly SwagnLag -2 — 7y
View all comments (2 more)
0
Thanks so much. OniSanYamate -17 — 7y
0
did it work? cuz it didnt for me XD SwagnLag -2 — 7y
Ad
Log in to vote
1
Answered by 7 years ago

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

0
I know how to make Animation But everytime i do it it doesn't work. OniSanYamate -17 — 7y

Answer this question