• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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