04-06-2008, 03:53 PM
Hello, im using vbkey's to open players inventory and such.
But i what i got stuck at is how to make the second time the player presses the key, the pic will close.
Ex. You press "i" and the inventory opens.
Then you hit "i" again and the inventory closes
Pretty simple?
This is the piece of code im using.
But i what i got stuck at is how to make the second time the player presses the key, the pic will close.
Ex. You press "i" and the inventory opens.
Then you hit "i" again and the inventory closes
Pretty simple?

This is the piece of code im using.
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = vbKeyI) Then
picPlayerInventory.Visible = True
End If
End Sub