Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Restart Button project/Scripts help
- TheCentipede
-
100+ posts
Restart Button project/Scripts help
Will somebody please help me with this, preferably a good programmer or scratcher. I have a game {Link below} In which you have to play through levels in order to advance, when you touch a certain sprite, the game ends, and you have to hit the green flag and restart the whole game. I want to know how to make an in game restart button which will let you restart in the level you died. Can someone please play the game a little, look at the scripts and tell me what to do or remix it fixed and post a link here. Link to game below. Thanks.
http://scratch.mit.edu/projects/13348411/
http://scratch.mit.edu/projects/13348411/
Last edited by TheCentipede (Nov. 26, 2014 23:19:03)
- shoresbeep
-
1000+ posts
Restart Button project/Scripts help
Ok, so make a restart sprite, and say:
And when the other things receive restart:
Do what you want them to do when green flag is clicked
And when the other things receive restart:
Do what you want them to do when green flag is clicked

- The_Scratch_Squad
-
1000+ posts
Restart Button project/Scripts help
Ok, so make a restart sprite, and say:
And when the other things receive restart:
Do what you want them to do when green flag is clicked
Actually, he said:
…when you touch a certain sprite,…
So it would be more like this:
Or something like that… not sure about the touching color thingy…
x= the sprite number or the sprite name?
Last edited by The_Scratch_Squad (Nov. 26, 2014 22:34:28)
- TheCentipede
-
100+ posts
Restart Button project/Scripts help
I'm so so sorry, I put the link tot he wrong game, which just happened to be named EPIC FAIL! Once again, so sorry. What a coincidence.
- Locomule
-
1000+ posts
Restart Button project/Scripts help
Create a new “when green flag clicked” that broadcasts Start.
Replace all your other “when green flag clicked” blocks with “when I receive Start”
except for that block in your Restart sprite, replace it with “when I receive End” and add a “when this sprite clicked” with a “broadcast Start” beneath it. Also, add a “when I receive Start” block followed by a “Hide” block.
ps. Using more than 1 “when green flag clicked” block can create all kinds of weird errors so only use one per project
Replace all your other “when green flag clicked” blocks with “when I receive Start”
except for that block in your Restart sprite, replace it with “when I receive End” and add a “when this sprite clicked” with a “broadcast Start” beneath it. Also, add a “when I receive Start” block followed by a “Hide” block.
ps. Using more than 1 “when green flag clicked” block can create all kinds of weird errors so only use one per project
Last edited by Locomule (Nov. 27, 2014 06:35:32)
- TheCentipede
-
100+ posts
Restart Button project/Scripts help
I tried the things you said but they didn't seem to work; Then I came up with a brilliant plan: I'll make a variable named backdrop name, and each time you beat a level, I'll add one, so when you die, the backdrop name variable will be sent to the restart button, so when you push it it will be able to tell what level you are on, will this work?
- Locomule
-
1000+ posts
Restart Button project/Scripts help
My earlier advice wasn't really intended to fix the button but rather was something you needed to do first. Now we are ready to fix it, but there are still many other issues. I'm not saying that your method won't work. But look at it this way, it is kind of like building a house of cards… If your foundation is shaky, you can build the house but it won't go very high before it becomes too unstable. Your project is the same way. So I will do a remix that fixes everything and you can compare it to your current version to see the methods I use to stabilize your work so far.
Please note that I am going to change your methods as little as possible so other than everything working, the game should function pretty much like you wish it did right now. I'll have it done as soon as possible tonight, just having some family issues at the moment. I will post here with a link to my remix when it is done.
Please note that I am going to change your methods as little as possible so other than everything working, the game should function pretty much like you wish it did right now. I'll have it done as soon as possible tonight, just having some family issues at the moment. I will post here with a link to my remix when it is done.
- Locomule
-
1000+ posts
Restart Button project/Scripts help
Ok, all done. I removed a lot of stuff that wasn't really doing anything or was redundant. There were a few blocks that weren't doing anything but looked like you might want them to do something later. I separated their scripts from the top block so they wouldn't run but left them in your project.
Check it out, see what you think, and let me know if you have any questions. Hope all this helps but you were already off to a great start so keep up the good work! I'll leave my remixed version up until I get a message from you here, so remix my remix (lol) and name it something like Backup so that you have a copy of it on your own account.
Check it out, see what you think, and let me know if you have any questions. Hope all this helps but you were already off to a great start so keep up the good work! I'll leave my remixed version up until I get a message from you here, so remix my remix (lol) and name it something like Backup so that you have a copy of it on your own account.
- AiraCruz
-
2 posts
Restart Button project/Scripts help
Hi, I need to know how to make my death count restart. Please help.
- Stephano1221
-
1 post
Restart Button project/Scripts help
When Green Flag Clicked Hi, I need to know how to make my death count restart. Please help.
Set DeathCounter to 0
- deck26
-
1000+ posts
Restart Button project/Scripts help
I suggest you start your own topic, this one is old. it's not working!!!!!
- GoAway101
-
1 post
Restart Button project/Scripts help
I got a Reset button to work on my first scratch. Please look through the code and be my critic.
https://scratch.mit.edu/projects/88790226/
https://scratch.mit.edu/projects/88790226/
- BF10
-
500+ posts
Restart Button project/Scripts help
Please do not necrobump. I got a Reset button to work on my first scratch. Please look through the code and be my critic.
https://scratch.mit.edu/projects/88790226/
- DenzilRobinson
-
2 posts
Restart Button project/Scripts help
Show me how to make a start button to start my game.
- Bruhdude123
-
1 post
Restart Button project/Scripts help
how do you restart the project you made that is ALREADY posted!?! i'm going crazy because i don't know!
- Discussion Forums
- » Help with Scripts
-
» Restart Button project/Scripts help