• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
  • 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)
 
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.
Back
Top