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

Is there of way of defining if a player as inputted a key twice?

Asked by 7 years ago

Is there a way of identifying if a player as inputted a keycode twice?

game:GetService("UserInputService").InputBegan:connect(function(LetsSee) if LetsSee.KeyCode == Enum.KeyCode.R then print("R was pressed") Sword.Parent = Character end end)

I'm trying to make it that once you press R again(twice) you unequip the tool

0
I am not entirely sure what you are asking, but I think you could just use an if statement and an else statement to determine whether to equip or unequip. KillPowerAlex135 5 — 7y
0
I can't use elseif and if because I'm trying to cause an event for each time r is pressed twice. dakanji123 97 — 7y
0
I am not entirely sure what you are asking. If you could give a detailed example that would be helpful. KillPowerAlex135 5 — 7y
0
Ok, I made a script that once i press R, i equip the tool. I am trying to make it so that if i press r again, I will un equip the tool. How could I cause an event to happen for each time R is pressed., How would I define if R was pressed again? dakanji123 97 — 7y

Answer this question