Discuss Scratch

Tommy100
Scratcher
100+ posts

Stop a Certain Script Block

Currently stop blocks only include: stop all, stop this script, stop other scripts in sprite. I really need this script for my game. Can you make another stop block option. Stop a certain script. I was thinking you would drag down from the stop script and when you clicked the option it would ask you, “Which script would you like to be stopped?” and then you would click on the script in the sprite. Would anyone find this script helpful? I would like Scratch Team to check this out.
Nether_before
Scratcher
1000+ posts

Stop a Certain Script Block

Support because this would be useful

~~If life gives you kumquats, lock your signature up, bury it in the ground and hope it's safe~~
hello child. i am an elf
Tommy100
Scratcher
100+ posts

Stop a Certain Script Block

Nether_before wrote:

Support because this would be useful
Thanks!
matey1234
Scratcher
1000+ posts

Stop a Certain Script Block

you can just put a stop this script in your script. no support.

| Artist | Gamer | Roleplayer | Weirdo | Lazy |

The_Scratch_Squad
Scratcher
1000+ posts

Stop a Certain Script Block

Workaround:
when green flag clicked
...
broadcast [Stop Script v]

when I receive [Stop Script v]
set [Stop 1 v] to [1]

when this sprite clicked
if <(Stop 1) = [1]> then

stop [This Script v]
else
...
end
This would most likely work, so no support.

REMEMBER! Clicky That Sticky AND Read it Carefully before making new topics.
Get the Worlds Fails on Math!!!
Tommy100
Scratcher
100+ posts

Stop a Certain Script Block

matey1234 wrote:

you can just put a stop this script in your script. no support.
The problem is, if you have to use wait blocks or glide blocks and you need the script to stop right away then it wouldn't work. Here's why I need that block: I'm making a game and in the enemy's script I need it. Here's the scripts:
when backdrop switches to [Game Starts v]
glide (...) secs to x: (...) y: (...)
glide (...) secs to x: (...) y: (...)
etc.


For the second script:
when backdrop switches to [game starts v]
forever

wait (...) secs
next costume
end



For the last script:

when backdrop switches to [game starts v]
forever

if <touching [missile v] ?> then
stop [script 2 v]
end

end

So as you can see, I can't put if <something> inside script 2 because it uses wait blocks. (Unless I used like 50 wait blocks like 0.01 second. Then if <this> then like 50 of those inside the same script!) I don't want script 1 to stop. I want script 3 to stop script 2. Do you get it now?
why_the_heck_not
Scratcher
8 posts

Stop a Certain Script Block

You could do this:
forever
if <(foo) = [stop]> then
stop [ v]


else

end
end
LP_Play
Scratcher
1000+ posts

Stop a Certain Script Block

when green flag clicked
...
broadcast [Stop Script v]

when I receive [Stop Script v]
set [Stop 1 v] to [1]

when this sprite clicked
if <(Stop 1) = [1]> then

stop [This Script v]
else
...
end

Thanks The_Scratch_Squad!

Last edited by LP_Play (July 29, 2016 21:09:10)


BaconAndEggs1
Scratcher
1000+ posts

Stop a Certain Script Block

LP_Play wrote:

-snip-

Thanks The_Scratch_Squad!

Check the last post date next time to avoid necroposting, this thread hasn't been active since April of last year.

Scratcher1002
Scratcher
1000+ posts

Stop a Certain Script Block

LP_Play wrote:

when green flag clicked
...
broadcast [Stop Script v]

when I receive [Stop Script v]
set [Stop 1 v] to [1]

when this sprite clicked
if <(Stop 1) = [1]> then

stop [This Script v]
else
...
end

Thanks The_Scratch_Squad!

Won't work. If someone clicked the sprite, and then met the requirements to stop the script, it'd just keep going because it will only check for this at the beginning of the script. Huge support. This could help a lot.
Sheep_maker
Scratcher
1000+ posts

Stop a Certain Script Block

How would one select the script to stop? Would this also stop scripts outside the sprite/stage?

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
LP_Play
Scratcher
1000+ posts

Stop a Certain Script Block

BaconAndEggs1 wrote:

LP_Play wrote:

-snip-

Thanks The_Scratch_Squad!

Check the last post date next time to avoid necroposting, this thread hasn't been active since April of last year.
Oh yeah, thanks for reminding me, I forgot to check the date!

iYoloPro
Scratcher
4 posts

Stop a Certain Script Block

My problem is when the background switches, I want it to stop repeating. And I set the stop block to this script.
turkey3
Scratcher
1000+ posts

Stop a Certain Script Block

Tommy100 wrote:

matey1234 wrote:

you can just put a stop this script in your script. no support.
The problem is, if you have to use wait blocks or glide blocks and you need the script to stop right away then it wouldn't work. Here's why I need that block: I'm making a game and in the enemy's script I need it. Here's the scripts:

Once people get to more advanced coding, though, they will likely not use glide blocks and may replace wait blocks with variable timers, allowing it to still work.

megaman100
Scratcher
100+ posts

Stop a Certain Script Block

Support
JobberWokker
New to Scratch
3 posts

Stop a Certain Script Block

Either this function is broken in v 3.0 or something is wrong. Stop script does't seem to be working.
gamebeater187
Scratcher
1000+ posts

Stop a Certain Script Block

The_Scratch_Squad wrote:

Workaround:
when green flag clicked
...
broadcast [Stop Script v]

when I receive [Stop Script v]
set [Stop 1 v] to [1]

when this sprite clicked
if <(Stop 1) = [1]> then

stop [This Script v]
else
...
end
This would most likely work, so no support.
Almost the hardest workaround ever, obviously the only harder workarounds are private messaging, cloud lists, “bounce” block, and so forth.

Besides, the workaround doesn't even work in 3.0.

Therefore, Support.

Last edited by gamebeater187 (Dec. 29, 2018 18:52:57)


My 1000th post!
I haven't changed my logo since my 96th post on 2014. Now at 1000 posts, I changed my logo!
ZappyBarbecue10
Scratcher
20 posts

Stop a Certain Script Block

Tommy100 wrote:

Currently stop blocks only include: stop all, stop this script, stop other scripts in sprite. I really need this script for my game. Can you make another stop block option. Stop a certain script. I was thinking you would drag down from the stop script and when you clicked the option it would ask you, “Which script would you like to be stopped?” and then you would click on the script in the sprite. Would anyone find this script helpful? I would like Scratch Team to check this out.
Support. Would help a lot with games with clones.
CalculatorFun
Scratcher
94 posts

Stop a Certain Script Block

If you want to stop a certain script, use the define block
define (x)
stop [this script v]

CodingKidz1544
Scratcher
39 posts

Stop a Certain Script Block

How would this work? Would scripts have to be numbered? No support.

Enter signature here…
Check out my new game, Platformer Maker!
set array [Array v] size to () rows and () columns :: list

replace array [Array v] row () column () to [] :: list

(value in [Array v] at row () column () :: list )

(array [Array v] number of [rows v] :: list )

Powered by DjangoBB