How would one go about making a combo system?

So I’m going to be creating a dragon ball styled combat system soon and I was curious how one would go about making a combo system similar to “L-L-R-L” etc. Obviously, it requires UIS, Animations, etc… to create but how would I go about it?

I had some ideas like,

local CombatString
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(Key, Chat)
    if not Chat then
       if Key.UserInputType == Enum.UserInputType.MouseButton1 then
          ComboString = "L"
       end
    end
end)

And do a similar thing with MouseButton2, but I don’t know how to make them connect and when the correct key combos make a actual combo.

1 Like

Could you elaborate more one the combat system your trying to make, the L L R L is confusing

Like when you click “L-L-R-L” (L = Left Click, R = Right Click) I am trying to create a system to where you use Left Click + Right Click for combos. My bad for not elaborating on that part more.

Oh alright I get what your saying,

Basically you could hold a control variable and then when the player hits the left click increment it and then when the player hits the left click increment it again and then right click and then left click until the control variable reaches a certain number and then do stuff
@dozkiuVII

local control = 0

uis.InputBegan:Connect(function(i,t)
	if t then return end
	if i.UserInputType == UserInputType.MouseButton1 and control == 0 then
		control += 1
	elseif i.UserInputType == UserInputType.MouseButton1 and control == 1 then
		control += 1
	elseif --- etc.
end)