Discuss Scratch

Ethgot
Scratcher
27 posts

Help with finding broken script

i'm trying to make it so you can choose a character in my game https://scratch.mit.edu/projects/530639863
but every time i choose the character Hank before choosing Character Keith only the character Keith is visible and character Hank is hidden there is a lot of junk code but i have a feeling i coded something wrong in either Hank or some other code to make character Hank hidden whenever backdrop switches to backdrop one please help.

legendary34678
Scratcher
1000+ posts

Help with finding broken script

Oh no not a find the broken code… But I'll do my best and report to you what I found!
————————————————–
Check out me projects please I'm desperate https://scratch.mit.edu/projects/552456810/ and https://scratch.mit.edu/projects/548785365/
Theo_1er
Scratcher
500+ posts

Help with finding broken script

Sprite4, replace
whenthisspriteclickedbroadcastkeithswitchcostumeto@564

by

whenthisspriteclickedswitchcostumeto@546wait0secsbroadcastkeith
legendary34678
Scratcher
1000+ posts

Help with finding broken script

I found it! It was fairly simple to find. There's one in Sprite4 which makes it HIDE instead of SHOW when the backdrop switches to backdrop3 (the choose your character backdrop). The other one was a lack of a script that makes Hank show when the backdrop switches to backdrop1. It didn't exist in the first place which is why you couldn't find a broken script!

There are multiple things I'd recommend you to do to prevent this in the future, though. Firstly, it looks like you have multiple of the same “When backdrop switches to” blocks, so how about combining them into one big one?

whenbackdropswitchestobackdrop1show

whenbackdropswitchestobackdrop1setcoinsto100

You can combine the above blocks into:

whenbackdropswitchestobackdrop1setcoinsto100show

That way, you can have less blocks to worry about! Also, try organizing the blocks neatly in rows and columns. I usually only have multiple “When green flag clicked” blocks if I need them to all start at once such as when I need 3 forever loops to occur simultaneously.

Powered by DjangoBB