Discuss Scratch

Pandan_the_coder
Scratcher
100+ posts

How do I repeatedly check a condition in order to add an item to a list, but only once?

How do I repeatedly check a condition in order to add an item to a list, but only once?

Join my collab series! —> https://scratch.mit.edu/discuss/topic/726760/
Nezon
Scratcher
1000+ posts

How do I repeatedly check a condition in order to add an item to a list, but only once?

when green flag clicked
forever
if <> then
add [] to [list v]
stop [this script v]
end
end

Or, better way:

when green flag clicked
wait until <>
add [] to [list v]

Last edited by Nezon (Jan. 14, 2022 01:54:42)


This is my signature (it goes automatically under every post I make)! Here is a bit of advice on foruming, by the way. Don't do SAND. SAND means four words.
SAND means Spam, Advertising, Necroposting, and Derailing.
Spam is when a irrelevant message is sent to many places. Wiki Article: Spam
Advertising is when you promote your studios and projects. Wiki Article: Advertising
Necroposting is when you post on a old topic. It distracts other helpers! Wiki Article: Necroposting
Derailing is when you post something that is irrelevant to the topic, like minimodding. It is called thread hijacking. Wiki Article: Derailing(Derailing idea comes from this guy),
in the process of leaving scratch.
bob has been hidden again :(

coder2045
Scratcher
1000+ posts

How do I repeatedly check a condition in order to add an item to a list, but only once?

forever
if <not <[list v] contains [something] ?>> then
add [something] to [list v]
end
end

Highlight this text and press Ctrl-Shift-Down to view more of my signature. There's a lot in there.
I FOUND THE POSTIE POSTIE POST LINK THIS
Brainteaser: What comes next? Answer on my profile. First correct answer gets a follow.

[ ]
[ [ ] ]
[ [ [ ] ] [ ] ]
Good projects ⬇️




Powered by DjangoBB