Discuss Scratch

Fused_Foxy_360
Scratcher
15 posts

I need Help.

I am making a game and i need help with it. I did this code and it wont change the costume it might be the <Costume name> = <Fully_Grown_Carrots>
. I changed it again and again and i do not know how to fix it. so here is the code:

when green flag clicked
forever
if <[costume name] = [Fully_Grown_Carrots]> then
forever
if <mouse down?> then
add [Carrot] to [Inventory]
switch costume to [Carrots Growing]
end


(You will be credited in the game if your comment fixed it!)

Last edited by Fused_Foxy_360 (Aug. 23, 2026 14:45:22)

1234not123abc
Scratcher
100+ posts

I need Help.

is the problem when the carrots are fully grown you cannot stop collecting?
bord_game12
Scratcher
9 posts

I need Help.

ok what is the problem? and can l see the game to help you?
grkw2020
Scratcher
500+ posts

I need Help.

Could you share the project? It's not clear exactly how the script works without seeing the other scripts at play.
bord_game12
Scratcher
9 posts

I need Help.

no l was trying to help Fused_Foxy_360
grkw2020
Scratcher
500+ posts

I need Help.

bord_game12 wrote:

no l was trying to help Fused_Foxy_360
???
CodeCooker321
Scratcher
25 posts

I need Help.

what's the problem? and what's the game?
joe1718
Scratcher
83 posts

I need Help.

Fused_Foxy_360 wrote:

I am making a game and i need help with it. I did this code and it does not work. I changed it again and again and i do not know how to fix it. so here is the code:

when green flag clicked
forever
if <[costume name] = [Fully_Grown_Carrots]> then
forever
if <mouse down?> then
add [Carrot] to [Inventory]
switch costume to [Carrots Growing]
end
Pleas share the project.
Fused_Foxy_360
Scratcher
15 posts

I need Help.

Sorry I took too long to respond here is the link:

https://scratch.mit.edu/projects/1370282914/
Called: Farm Life | 1.0 |
Fused_Foxy_360
Scratcher
15 posts

I need Help.

1234not123abc wrote:

is the problem when the carrots are fully grown you cannot stop collecting?
no it isn't that. I just found out an solution for that.

Last edited by Fused_Foxy_360 (Aug. 23, 2026 14:43:35)

grkw2020
Scratcher
500+ posts

I need Help.

Fused_Foxy_360 wrote:

1234not123abc wrote:

is the problem when the carrots are fully grown you cannot stop collecting?
no it isn't that. I just found out an solution for that.
Well what is the problem?
Lilyheart5Warriors
Scratcher
9 posts

I need Help.

Try removing the second forever block! It should still work if it's like this.
when green flag clicked
forever
if <(costume [name v])=(Fully_Grown_Carrots)> then
if <mouse down?> then
add [Carrot] to [Inventory v]
switch costume to [Carrots Growing v]
end
end
end
Fused_Foxy_360
Scratcher
15 posts

I need Help.

Lilyheart5Warriors wrote:

Try removing the second forever block! It should still work if it's like this.
when green flag clicked
forever
if <(costume [name v])=(Fully_Grown_Carrots)> then
if <mouse down?> then
add [Carrot] to [Inventory v]
switch costume to [Carrots Growing v]
end
end
end
I just did that. Even changed it a little and still did not work.

Lilyheart5Warriors
Scratcher
9 posts

I need Help.

I'll have a look at the project.
Edit: I think I figured it out!
Original code:
when I receive [ALL ITEMS SHOW v]
switch costume to (Carrots Growing v)
forever
wait (60) seconds
switch costume to (Fully_Grown_Carrots v)
if <(costume [name v]) = (Fully_Grown_Carrots)> then
if <mouse down?> then
add (Carrot) to [Inventory v]
end
end
end

New code, which I tested and it worked:

when I receive [ALL ITEMS SHOW v]
broadcast [Carrots, grow! v]

when I receive [Carrots, grow! v]
set (Carrots grown? v) to [n]
switch costume to (Carrots Growing v)
wait (60) seconds
set (Carrots grown? v) to [y]
switch costume to (Fully_Grown_Carrots v)
repeat until <(Carrots grown?) = [n]>
if <mouse down?> then
add [Carrot] to [Inventory v]
set (Carrots grown? v) to [n]
broadcast [Carrots, grow! v]
end
end

Last edited by Lilyheart5Warriors (Aug. 27, 2026 12:15:49)

Fused_Foxy_360
Scratcher
15 posts

I need Help.

Lilyheart5Warriors wrote:

I'll have a look at the project.
Edit: I think I figured it out!
Original code:
when I receive [ALL ITEMS SHOW v]
switch costume to (Carrots Growing v)
forever
wait (60) seconds
switch costume to (Fully_Grown_Carrots v)
if <(costume [name v]) = (Fully_Grown_Carrots)> then
if <mouse down?> then
add (Carrot) to [Inventory v]
end
end
end

New code, which I tested and it worked:

when I receive [ALL ITEMS SHOW v]
broadcast [Carrots, grow! v]

when I receive [Carrots, grow! v]
set (Carrots grown? v) to [n]
switch costume to (Carrots Growing v)
wait (60) seconds
set (Carrots grown? v) to [y]
switch costume to (Fully_Grown_Carrots v)
repeat until <(Carrots grown?) = [n]>
if <mouse down?> then
add [Carrot] to [Inventory v]
set (Carrots grown? v) to [n]
broadcast [Carrots, grow! v]
end
end
THANK YOU SO MUCH! I will credit you in the notes in credits spot.

Powered by DjangoBB