Discuss Scratch

killrcreepr
Scratcher
8 posts

Health Scripts For Clones

AMarioFan0098 wrote:

I Used This Method:

First I set the Variable Health to This Sprite Only Then I did this Script.

When Green Flag Clicked
Forever
Wait 0.1 Seconds
Create Clone
End Of Script

When I Start As Clone
Set Health To (Your Clones Health)
Forever
If Touching Any Then
Change Health By -1
If Health = 0, Or If Health < 0 Then
Hide
End Of Script

I Don't Know How To Use Scratch Blocks. Sorry But Hope This Helps.

Asteroids Engine. This Is The Game That Sorta Uses The Script.

Does this code work if there are multiple clones at once?
Lizalfolos
Scratcher
10 posts

Health Scripts For Clones

existify wrote:

this script works and its easy and simple too easy if you ask me
first add costumes they represent health

when I start as a clone 
switch costume to [ first costume]
forever
if <touching stuff> then
next costume
wait (0.1) secs
end
if <<(costume #) < [end of costumes]> or <(costume #) = [end of costumes]>> then
delete this clone
end
end
I will try that thanks!
MeIzAwezomeDede
Scratcher
1000+ posts

Health Scripts For Clones

TopGG wrote:

: P It didn't even show the advertisement…. *sigh*
I think that's because it's a signature. You derailed the topic by saying that honestly

Also I think I should report this to be closed, it's been heavily necroposted
Lizalfolos
Scratcher
10 posts

Health Scripts For Clones

killrcreepr wrote:

AMarioFan0098 wrote:

I Used This Method:

First I set the Variable Health to This Sprite Only Then I did this Script.

When Green Flag Clicked
Forever
Wait 0.1 Seconds
Create Clone
End Of Script

When I Start As Clone
Set Health To (Your Clones Health)
Forever
If Touching Any Then
Change Health By -1
If Health = 0, Or If Health < 0 Then
Hide
End Of Script

I Don't Know How To Use Scratch Blocks. Sorry But Hope This Helps.

Asteroids Engine. This Is The Game That Sorta Uses The Script.

Does this code work if there are multiple clones at once?
I dont think so, This is what i am trying to figure out. Right now I only have it so each clone only has 1 health point so it makes the gun that shoots fastest the best.
zksoon1
Scratcher
87 posts

Health Scripts For Clones

when green flag clicked
forever
create clone of [ myself]
end
this my script how do you make health for it?

Last edited by zksoon1 (Nov. 18, 2020 16:45:58)

zksoon1
Scratcher
87 posts

Health Scripts For Clones

i found out that you don't need health instead make up for it with numbers of clones

Powered by DjangoBB