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

4 comments

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.

0

I can't use elseif and if because I'm trying to cause an event for each time r is pressed twice.

0

I am not entirely sure what you are asking. If you could give a detailed example that would be helpful.

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?