I am doing a project for school, and I have a problem. I have lasers that appear and vanish every few seconds, and the player must navigate them. I am using a simple system of:
-Forever
| SHOW
|WAIT 1 SEC
| HIDE
| WAIT 2 SEC
____________
To control when the lasers pop up.
This works fine, but then, once the player makes contact with an object called SER (Smooth Endoplasmic Reticulum) , SER broadcasts "Card Show." Card show causes a card to pop up on the screen which displays information on SER. I have the scripts set so that when key "F" is pressed, the SER card will hide.
Now I want the lasers to hide, and I have it set so that when "F" is pressed, not only will the card hide, but the lasers will too. What is happening is that the forever loop shown above causes the order to hide issued from the "F" key to happen, but then it just goes right back to the hiding and showing of the lasers!
I was wondering if any of you guys know how to stop the script in the forever loop (but not ALL the scripts) when f is pressed so that there won't be random lasers popping up every few seconds throughout the rest of my game
If you need any more clarification on the problem, just ask me in a post.
Thanks so much- FCbarcal0na
Offline
Hm... well, if the lasers won't need to show once again after being hidden with the 'f' key, you can just replace the forever block with "repeat until <key f pressed>". The entire script will then stop. You shouldn't need a separate script to make sure that it's hidden either, because the loop will finish the block of script it's currently running first.
Offline
Thank you SO much Harakou! Your solution worked perfectly andn ow I can continue with my project!
Thanks!- FCbarcal0na
Offline
use a veriable that sets to 1 then ise
when variable =1
stop script
Offline