in a project that i made, there is a part where a sprite (called moving platform) constantly tells all of its clones to run some code. it does this making use of a forever loop:
however: when the top script is run after being re-triggered, (by re-sending the "start" message) the block in the forever loop only runs once. this might be a bug, or something might be wrong with my code.
please help me figure out what's wrong and fix it.
Thank you!
If you broadcast start while the when I receive start script is running, it won't run again, because the script is already running. You'd need to stop the script before running it again, either with a repeat until instead of a forever loop, or by using the stop block.
And as @joecooldoo said, you are running a forever loop inside a forever loop. You might want to either remove the forever loop inside the custom block, or from the script running the custom block (I would remove it from the custom block, so I can run other code after running it, but also being able to run it again).
this kind of works:
but if a non-cloned sprite sets its parent to something, this block reports true.
I couldn't think of any better ways to do this, so I think which one you use just depends on what kind of clones you're using.
if you set myParent of a sprite to another sprite, this sprite is now a permanent clone...
if you want to try:
create 2 sprites (sprite1 & sprite 2)
in scripting area into sprite 1: drop any blocks
goto scripting are into sprite 2 (empty):
-set the parent to sprite 1
-drop the block inherit(script) block and run it...
-all the blocks from sprite 1 are imported into sprite 2