Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Clones responding to messages
- kooqle
- Scratcher
74 posts
Clones responding to messages
Hi everyone! I'm making a game where clones have to respond to messages. Is this possible (the clones already have a clone ID. Thank you
Cloud Inc.Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.
-Cloud Inc. Team ☁
- Jaim_animation
- Scratcher
77 posts
Clones responding to messages
This Is Possible. Just Use The
when I receive [ Any Massage v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Last edited by Jaim_animation (March 23, 2024 08:18:21)
Hope It Helps!
—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection
scratch blue infection! try to prevent it, but how?
- kooqle
- Scratcher
74 posts
Clones responding to messages
This Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Massage v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
when I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
Cloud Inc.Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.
-Cloud Inc. Team ☁
- TheUltimateHoodie
- Scratcher
1000+ posts
Clones responding to messages
This Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Massage v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
endwhen I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.say [Thanks for your reply!]
when green flag clickedhad to edit this multiple times because scratchblocks kept breaking
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
Last edited by TheUltimateHoodie (March 23, 2024 09:49:16)
can somebody give me something to put in my signature
- kooqle
- Scratcher
74 posts
Clones responding to messages
Thank you!
Cloud Inc.Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.
-Cloud Inc. Team ☁
- kooqle
- Scratcher
74 posts
Clones responding to messages
Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…This Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Message v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
endwhen I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.say [Thanks for your reply!]when green flag clickedhad to edit this multiple times because scratchblocks kept breaking
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
when green flag clicked
set [Clonemessage v] to [0]
when I receive [ v]
change [Clonemessage v] by (1)
when I start as a cloneAnd do whatever it needs to do!
wait until <><(foo) = [1]>
Cloud Inc.Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.
-Cloud Inc. Team ☁
- Jaim_animation
- Scratcher
77 posts
Clones responding to messages
This Topic Is For Broadcasting, Not For Another Way Which Works The Same, You Could Tell Us Using Variables Instead Is Also OkSadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…This Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Message v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
endwhen I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.say [Thanks for your reply!]when green flag clickedhad to edit this multiple times because scratchblocks kept breaking
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
endwhen green flag clicked
set [Clonemessage v] to [0]when I receive [ v]
change [Clonemessage v] by (1)when I start as a cloneAnd do whatever it needs to do!
wait until <><(foo) = [1]>
Hope It Helps!
—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection
scratch blue infection! try to prevent it, but how?
- Jaim_animation
- Scratcher
77 posts
Clones responding to messages
Wait, Then How DoThis Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Massage v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
endwhen I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.say [Thanks for your reply!]
when I receive [Anything v]
delete this cloneDeletes All Of The Clones Of The Sprite? Wait I Got It- The First Method I Described Does Not Works, But Second Method Works!
May Be The Method That Actually Works Is-
when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
[/scratchblocks]
[/quote]
Last edited by Jaim_animation (March 24, 2024 07:24:23)
Hope It Helps!
—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection
scratch blue infection! try to prevent it, but how?
- TheUltimateHoodie
- Scratcher
1000+ posts
Clones responding to messages
I don't know why my method didn't work; I have used it numerous times.Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…This Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Message v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
endwhen I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.say [Thanks for your reply!]when green flag clickedhad to edit this multiple times because scratchblocks kept breaking
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
endwhen green flag clicked
set [Clonemessage v] to [0]when I receive [ v]
change [Clonemessage v] by (1)when I start as a cloneAnd do whatever it needs to do!
wait until <><(foo) = [1]>
Anyway, your friend's solution still have the same concept.
can somebody give me something to put in my signature
- Jaim_animation
- Scratcher
77 posts
Clones responding to messages
Guys What's Going On There? The Problem Is Solved! PLEASE CLOSE THIS TOPIC!I don't know why my method didn't work; I have used it numerous times.Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…This Is Possible. Just Use TheThanks, but anything not under thewhen I receive [ Any Message v]block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
endwhen I start as a cloneblock will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.say [Thanks for your reply!]when green flag clickedhad to edit this multiple times because scratchblocks kept breaking
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
endwhen green flag clicked
set [Clonemessage v] to [0]when I receive [ v]
change [Clonemessage v] by (1)when I start as a cloneAnd do whatever it needs to do!
wait until <><(foo) = [1]>
Anyway, your friend's solution still have the same concept.
Hope It Helps!
—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection
scratch blue infection! try to prevent it, but how?
- Discussion Forums
- » Help with Scripts
- » Clones responding to messages