Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » How to make it so when a variable goes to 0 it will Turn back to 100?
- CookieGamer1119
- Scratcher
2 posts
How to make it so when a variable goes to 0 it will Turn back to 100?
Im making a shooter game but when I put a code similar to this that didn't function. can somebody please help?
- Hello3Rules
- Scratcher
100+ posts
How to make it so when a variable goes to 0 it will Turn back to 100?
when green flag clicked
forever
if <(☁ score) = [0]> then
set [ score] to [100]
end
If i understood it correctly, is this what you mean?
Last edited by Hello3Rules (Jan. 16, 2022 06:31:17)
▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▎
●●●●●●●●●●●●●●●●●●●●●●●●
●• 10⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀☘⠀⠀●
●• ꜱʜᴇ/ʜᴇʀ⠀⠀⠀⠀⠀⠀⠀⠀⠀☘⠀⠀●
●• ɪɴᴛʀᴏᴠᴇʀᴛ | ♓︎⠀⠀⠀⠀⠀☘⠀⠀●
●●●●●●●●●●●●●●●●●●●●●●●●
▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▎
llılılı. ♪♫llılılı. ♪♫llılılı. ♪♫llılılı. ♪♫llılılı. ♪♫llılılı.
- dhuls
- Scratcher
1000+ posts
How to make it so when a variable goes to 0 it will Turn back to 100?
(#2)That doesn't work.when green flag clicked
if <(☁ score) = [0]> then
set [ v] to [100]
end
You need to use a forever loop
when green flag clicked
forever
if <(variable) = [0]> then
set [variable v] to [100]
end
end
- Hello3Rules
- Scratcher
100+ posts
How to make it so when a variable goes to 0 it will Turn back to 100?
(#2)That doesn't work.when green flag clicked
if <(☁ score) = [0]> then
set [ v] to [100]
end
You need to use a forever loopwhen green flag clicked
forever
if <(variable) = [0]> then
set [variable v] to [100]
end
end
omg i just forgotted. thank you for reminding ^^
▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▎
●●●●●●●●●●●●●●●●●●●●●●●●
●• 10⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀☘⠀⠀●
●• ꜱʜᴇ/ʜᴇʀ⠀⠀⠀⠀⠀⠀⠀⠀⠀☘⠀⠀●
●• ɪɴᴛʀᴏᴠᴇʀᴛ | ♓︎⠀⠀⠀⠀⠀☘⠀⠀●
●●●●●●●●●●●●●●●●●●●●●●●●
▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▎
llılılı. ♪♫llılılı. ♪♫llılılı. ♪♫llılılı. ♪♫llılılı. ♪♫llılılı.
- CookieGamer1119
- Scratcher
2 posts
How to make it so when a variable goes to 0 it will Turn back to 100?
didn't work! (by the poster of the thread)(#2)That doesn't work.when green flag clicked
if <(☁ score) = [0]> then
set [ v] to [100]
end
You need to use a forever loopwhen green flag clicked
forever
if <(variable) = [0]> then
set [variable v] to [100]
end
end
- Discussion Forums
- » Questions about Scratch
- » How to make it so when a variable goes to 0 it will Turn back to 100?