Hi, i was trying to get a variable changed when the space key is pressed and that variable makes a while loop start, and then at a certain point the variable is changed back to make the while loop stop.
here is an example of what i mean.
function test()
{
while(a == 1)
{
g = 6;
a = 0;
wait(1);
}
}
function run_101()
{
while(1)
{
if(key_space)
{
a = 1;
}
wait(1);
}
}
Except while i am holding the space key a continues to equal 1, i just want it to equal one when the space key is pressed and then go about the while loop and act like the space key was released right away even if i am holding it down. I tried putting a while(key_space){wait(1);} in there but that requires me to let the space key up for it to trigger. I tried using on_space also but it crashes.
I also need to be able to do this more than once so its in a while loop.
Can any1 help?