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

Trying to make combo system i need help on methods?

so I’m testing methods on making a combo system so far I’ve got nothing since I don’t know how (I know, pretty pathetic). Now I ask you guys to please help me make a combo system.

Right know, all I got is:

local UIS = game:GetService(“UserInputService”)

local count = 0
UIS.InputBegan:Connect(function(input,gameProcessed)
  if gameProcessed then return end
  if input.KeyCode == Enum.KeyCode.E then
   count = count + 1
   print(count)
  end 
end)

now what I’m trying to do is whenever you don’t press it for (X) seconds the count must reset to 0. How would I do this? Thanks!

1 answer

Simply add a wait() after adding the count.

local UIS = game:GetService(“UserInputService”)

local count = 0
UIS.InputBegan:Connect(function(input,gameProcessed)
  if gameProcessed then return end
  if input.KeyCode == Enum.KeyCode.E then
   count = count + 1
if count == x then 
-- Code here
count = 0
end
   print(count)
wait(x)
count = 0
  end 
end)

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