Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Hide variables when game stops
        ![[RSS Feed] [RSS Feed]](//cdn.scratch.mit.edu/scratchr2/static/__5b3e40ec58a840b41702360e9891321b__//djangobb_forum/img/feed-icon-small.png)  
- iSCRATCH456
- 
                             Scratcher Scratcher
21 posts
Hide variables when game stops
So I have a game with 2 variables and I want it to be when the stop button is clicked, it hides them. Is there any way to do that?
variabubbles lol
                        
                        
                    variabubbles lol
- iSCRATCH456
- 
                             Scratcher Scratcher
21 posts
Hide variables when game stops
Yeah, I've tried that, but how do I hide it when the stop button is clicked?hide variable [var v]
- TheNoisyNoisy
- 
                             Scratcher Scratcher
100+ posts
Hide variables when game stops
Yeah, I've tried that, but how do I hide it when the stop button is clicked?hide variable [var v]
when this sprite clickedim so dumb i thought you meant a literal stop button not the ui stop button
hide variable [var v]
Last edited by TheNoisyNoisy (July 30, 2024 15:41:26)
- bRuHbRuHmEmEmAn
- 
                             Scratcher Scratcher
500+ posts
Hide variables when game stops
So I have a game with 2 variables and I want it to be when the stop button is clicked, it hides them. Is there any way to do that?This is a simple “stop button clicked” detector.
variabubbles lol
when green flag clickedUsing this code, once you click the stop button, it will look like the project is still running, but because you're using a timer variable (sensing), the project will still run. However, variables will stop changing once the stop button is clicked, causing the “when timer > timer” section to execute. Hope this helps!
forever
set [timer v] to (timer)
end
when [timer v] > (timer :: variables)
... // Code goes here
- iSCRATCH456
- 
                             Scratcher Scratcher
21 posts
Hide variables when game stops
Sorry it took me so long to reply, but when you say “code goes here”, what code do you mean?So I have a game with 2 variables and I want it to be when the stop button is clicked, it hides them. Is there any way to do that?This is a simple “stop button clicked” detector.
variabubbles lolwhen green flag clickedUsing this code, once you click the stop button, it will look like the project is still running, but because you're using a timer variable (sensing), the project will still run. However, variables will stop changing once the stop button is clicked, causing the “when timer > timer” section to execute. Hope this helps!
forever
set [timer v] to (timer)
end
when [timer v] > (timer :: variables)
... // Code goes here
(EDIT: Nevermind, I figured it out. Thank you so much!!!)
Last edited by iSCRATCH456 (July 30, 2024 19:36:43)
- Discussion Forums
- » Help with Scripts
- 
            » Hide variables when game stops ![[RSS Feed] [RSS Feed]](//cdn.scratch.mit.edu/scratchr2/static/__5b3e40ec58a840b41702360e9891321b__//djangobb_forum/img/feed-icon-small.png)  
 
            ![[RSS Feed] [RSS Feed]](http://cdn.scratch.mit.edu/scratchr2/static/__5b3e40ec58a840b41702360e9891321b__//djangobb_forum/img/feed-icon-small.png)


