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

How do I make this combat system?

Asked by 6 years ago
Edited 6 years ago

So I'm trying to make a Dragon Ball game, and if you press Q you punch, but how do I make it so the second time you press q you punch with your other hand then, third time you press Q you kick? An example of this system is in this Dragon ball game:

https://gyazo.com/de087de971aced976e63090dd417ac3b

In this GIF i'm pressing Q and it's attacking in an order

1 answer

Log in to vote
0
Answered by 6 years ago

Make a local bool variable, something like:

-- q punch script with first hand
local donefirstpunch = true
if donefirstpunch == true then
-- q punch script with second hand
donefirstpunch = false

Of course, you can choose what the variable's named - I just named it "donefirstpunch" to clarify.

0
I prefer to use a number value so you can add more than 2 moves Bellyrium 310 — 6y
Ad

Answer this question