You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
make a key combination that functions things in order -
What is the issue? Include screenshots / videos if possible!
I cant figure out how to involve tick when trying to create a key combination in order -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried using tick, I also looked in dev forum, cant find anything that is what i’m looking for
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I hope you can understand my problem, i am trying to make it so that you have to press z,x,and c, in order, and you do not have to hold the keys for it to work, and when you press them all in order, it changes walkspeed to 50, and i tried using tick so that whenever you dont press a key for 1 second, the combination restarts.
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")
local streak = 1
local PreviousPunch = 0
local canSprint = 1
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.Z and canSprint == 1 then
if tick() - PreviousPunch <= 1 then
streak = 1
canSprint = 2
print("1")
streak = streak + 1
else
canSprint = 1
print("reset")
streak = 1
end
PreviousPunch = tick()
end
if key.KeyCode == Enum.KeyCode.X and canSprint == 2 then
if tick() - PreviousPunch <= 1 then
streak = 1
canSprint = 3
streak = streak + 1
print("2")
else
canSprint = 1
print("reset")
streak = 1
end
PreviousPunch = tick()
end
if key.KeyCode == Enum.KeyCode.C and canSprint == 4 then
if tick() - PreviousPunch <= 1 then
streak = 1
canSprint = 1
print("3")
if streak >= 3 then
hum.WalkSpeed = 50
canSprint = 1
print("finished")
end
streak = streak + 1
else
print("reset")
canSprint = 1
streak = 1
end
PreviousPunch = tick()
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.