Is clone?: Difference between revisions

From PenguinMod Wiki
Is clone?
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Line 2: Line 2:
|block_img = <gallery>
|block_img = <gallery>
Block 5 1 2023-5 50 23 PM.png|Block
Block 5 1 2023-5 50 23 PM.png|Block
IsCloneRuntimeBlock.png|Block (Runtime Modifications)
IsCloneWorkaround.png|Workaround
IsCloneWorkaround.png|Workaround
</gallery>
</gallery>
Line 8: Line 9:
|title = is clone?
|title = is clone?
}}
}}
The '''is clone?''' block is a boolean block used for clones to detect if they are a clone or the main sprite. There are versions of this block in the [[Clones+]] extension, and the [[Runtime Modifications]] extension.
The '''is clone?''' block is a boolean block used for clones to detect if they are a clone or the main sprite. There are versions of this block in the [[Clones+]] extension, and in the [[Runtime Modifications]] extension.
==Uses==
==Uses==
It can be used for broadcasts to run scripts for only the sprite or for only clones, as clones receive broadcasts.
It can be used for broadcasts to run scripts for only the sprite or for only clones, as clones receive broadcasts.

Revision as of 00:20, 24 January 2024

is clone?
...
[[File:|200px]]
Caption
Block Type Boolean Block
Category / Extension Clones+
Runtime Modifications
Status Who tf uses status

The is clone? block is a boolean block used for clones to detect if they are a clone or the main sprite. There are versions of this block in the Clones+ extension, and in the Runtime Modifications extension.

Uses

It can be used for broadcasts to run scripts for only the sprite or for only clones, as clones receive broadcasts.

Workaround

This block can be worked around by using the fact that each clone has their own copy of a variable if it is sprite only, so creating a sprite only variable and setting it to 0 for the main sprite but 1 when clones are created and checking the value works.