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

Trying to make combo system i need help on methods? [closed]

Asked by
Grazer022 128
4 years ago

This question already has an answer here:

Methods for making a combo system?

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!

Marked as Duplicate by Leamir

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by 4 years ago

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)
Ad