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

Is this how you make a combo punching system?

Asked by 7 years ago
Edited 7 years ago

So basically, I want it so that when you press q you punch once with one hand, then the second time you press q it punches with other hand. I've gotten answers on another question, but I cannot add it to this type of script can someone help me? How do I add an If statement to a mouse.Keydown ? Is there any syntax mistakes?

01local player = game.Players.LocalPlayer
02repeat wait() until player.Character.Humanoid
03local humanoid = player.Character.Humanoid
04local mouse = player:GetMouse()
05donefirstpunch = false
06 
07local anim = Instance.new("Animation")
09 
10local anim1 = Instance.new("Animation")
12 
13    mouse.KeyDown:connect(function(key)
14    if key == "q" then
15        local playAnim = humanoid:LoadAnimation(anim)
View all 32 lines...

1 answer

Log in to vote
1
Answered by 7 years ago
01local player = game.Players.LocalPlayer
02repeat wait() until player.Character.Humanoid
03local humanoid = player.Character.Humanoid
04local mouse = player:GetMouse()
05move = 1 -- add this instead
06 
07local anim = Instance.new("Animation")
09 
10local anim1 = Instance.new("Animation")
12 
13    mouse.KeyDown:connect(function(key)
14    if key == "q" and move == 1 then
15        move = 2 -- change the value
View all 22 lines...
Ad

Answer this question