Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » wanting to make a sprite to make 5 clones of itself but it makes a lot more than it should when you spam or hold the key that causes the clones to be made
- radiantcat
-
Scratcher
16 posts
wanting to make a sprite to make 5 clones of itself but it makes a lot more than it should when you spam or hold the key that causes the clones to be made
https://scratch.mit.edu/projects/892018885/ more context here,
i've tried adding a “cooldown” with variables which kinda worked but i want it to just make 5 clones every time, not whatever it's doing
i've tried adding a “cooldown” with variables which kinda worked but i want it to just make 5 clones every time, not whatever it's doing
Last edited by radiantcat (Sept. 12, 2023 01:17:19)
- Thingied
-
Scratcher
1000+ posts
wanting to make a sprite to make 5 clones of itself but it makes a lot more than it should when you spam or hold the key that causes the clones to be made
Okay so the problem is that the clones are cloning themselves whenever you press X. To fix this all you have to do is make variable with “For this sprite only” ticked and use it to tell if the script is being ran by the main sprite or the clone.
(In this example the variable is “IsClone”)

(In this example the variable is “IsClone”)

- p-p-p-p-p-p-p-p-p-p-
-
Scratcher
1000+ posts
wanting to make a sprite to make 5 clones of itself but it makes a lot more than it should when you spam or hold the key that causes the clones to be made
Okay so the problem is that the clones are cloning themselves whenever you press X. To fix this all you have to do is make variable with “For this sprite only” ticked and use it to tell if the script is being ran by the main sprite or the clone.I personally like the usage of “Generation”, and then having the clone change “gen” by 1 when it is created, this way clones can be more 3d. But your solution also works.
(In this example the variable is “IsClone”)
- roomhj
-
Scratcher
16 posts
wanting to make a sprite to make 5 clones of itself but it makes a lot more than it should when you spam or hold the key that causes the clones to be made
you can move the x event to another sprite.
- Discussion Forums
- » Help with Scripts
-
» wanting to make a sprite to make 5 clones of itself but it makes a lot more than it should when you spam or hold the key that causes the clones to be made