• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Possible to detect press space bar if not how can I detect an arrow key press twice

Status
Not open for further replies.
Level 9
Joined
Apr 3, 2008
Messages
700
  • Events
    • Player - Player 1 (Red) Presses the Left Arrow key
  • Actions
    • Set i = (i + 1)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • i Equal to 2
    • Then - Actions
      • Set i = 0
      • <actions>
    • Else - Actions
Time check is possible too buts it's harder. I think you can null variable after some time. And, in multiplayer you'll need local variables. (local integer i)
 
Level 24
Joined
Jun 14, 2005
Messages
2,506
Heres a quick trigger I came up with.

  • KeyPressed
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UpArrowPressed Equal to True
        • Then - Actions
          • Set UpArrowPressed = False
          • Skip remaining actions
        • Else - Actions
      • Set UpArrowPressed = True
The variable UpArrowPressed is a Boolean, and what it does is it will set the variable to true when the arrow key is pressed, and then you can put whatever actions in you want in the If/Then/Else function.

Edit: Damn someone posted before me :p
 
Status
Not open for further replies.
Top