I'm used to C-Script still, so this may be partially wrong.
but something like
...
while(key_i != 1){wait(1);} //this waits until key I is pressed
set(inventory_pan, VISIBLE); // this sets the inventory panel visible
while(key_i != 0){wait(1);} // this waits until key I is released to continue with the code. this prevents holding the I key.
//now the next lines of code go into the inventory panel code
while(1)
{
if(key_i == 1)
{
reset(inventory_pan, VISIBLE);
}
wait(1);
}
...
and if you want a button to do it...
//put this code on the "click" function of the button
if(inventory_pan.VISIBLE == 1)
{
reset(inventory_pan, VISIBLE);
}
else
{
set(inventory_pan, VISIBLE);
}
^^This code is most likely wrong however you get the idea. As I said, i'm still used to C-Script but I do know some lite-C.