Discuss Scratch

KritzkriegKane
Scratcher
4 posts

No-Clone Deleting

HI all

How am I supposed to make a script which makes things delete themselves (and stop their script temporarily) and make them work/appear again
scubajerry
Scratcher
1000+ posts

No-Clone Deleting

A lot has to do with who is deciding to delete the clones. If it is something other than the clone, when you create the clone, you should have a variable that contains the “number” of the clone are creating. The clone should store ITS number away in a FOT THIS SPRITE ONLY variable.
In some sprite or stage

set [Clone to delete v] to [8 ]
broadcast [delete clone v]


In clone
when I receive [ delete clone v]
if <(Clone to Delete) = (My Clone ID) > then

delete this clone
end

Last edited by scubajerry (April 26, 2016 16:13:20)

Mole_Gaming
Scratcher
100+ posts

No-Clone Deleting

you could use the
hide
block to make them disappear, then use the
show
block to show them
MellerReal
Scratcher
88 posts

No-Clone Deleting

I use it like this:
when green flag clicked
forever
create clone of [myself v]
wait (2) secs
end


when I start as a clone
show
glide (5) secs to x: (0) y: (0)
wait (5) secs
hide
delete this clone

That's how I use for this: https://scratch.mit.edu/projects/105987186/

Share your project and it'll be a bit easier to help.

Last edited by MellerReal (April 26, 2016 18:10:29)

deck26
Scratcher
1000+ posts

No-Clone Deleting

MellerReal wrote:

I use it like this:
when green flag clicked
forever
create clone of [myself v]
wait (2) secs
end


when I start as a clone
show
glide (5) secs to x: (0) y: (0)
wait (5) secs
hide
delete this clone

That's how I use for this: https://scratch.mit.edu/projects/105987186/

Share your project and it'll be a bit easier to help.
No point hiding the clone if you're deleting it with the next block though.
KritzkriegKane
Scratcher
4 posts

No-Clone Deleting

Mole_Gaming wrote:

you could use the
hide
block to make them disappear, then use the
show
block to show them

For some reason the script is still working even tho the thing is gone…
deck26
Scratcher
1000+ posts

No-Clone Deleting

KritzkriegKane wrote:

Mole_Gaming wrote:

you could use the
hide
block to make them disappear, then use the
show
block to show them

For some reason the script is still working even tho the thing is gone…
Scripts will still run for hidden sprites but not for deleted clones. Use a variable if necessary to keep track of whether a sprite is visible and only run the loops in the scripts when the variable has the value indicating it is showing.
0xF3d04a
Scratcher
54 posts

No-Clone Deleting

I don't believe you can get scripts to stop, but you can get them to pause.
wait until <>
deck26
Scratcher
1000+ posts

No-Clone Deleting

0xF3d04a wrote:

I don't believe you can get scripts to stop, but you can get them to pause.
wait until <>
stop [this script v]
stop [other scripts in sprite v]

Powered by DjangoBB