Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » why are some of my enemies invincible
- NitoReagan
-
Scratcher
61 posts
why are some of my enemies invincible
I don't see anything wrong with my code but for some reason some of the enemy clones that spawn either have a boat load of health or just don't take damage
https://scratch.mit.edu/projects/851344592
https://scratch.mit.edu/projects/851344592
- rodper6635
-
Scratcher
100+ posts
why are some of my enemies invincible
It's that the enemies' health goes under 0 if the bullet hits them before exploding, and they only delete if their health is exactly 0. Edit the “delete” script like this script;
when I start as a cloneYou might also want to slow down the bullet because it's going so fast it doesn't collide.
set [Health v] to [0]
show
forever
if <(Health) < [0]> then
change [Score v] by [1]
delete this clone
end
end
Last edited by rodper6635 (May 16, 2023 15:04:55)
- NitoReagan
-
Scratcher
61 posts
why are some of my enemies invincible
It's that the enemies' health goes under 0 if the bullet hits them before exploding, and they only delete if their health is exactly 0. Edit the “delete” script like this script;TYSM!when I start as a cloneYou might also want to slow down the bullet because it's going so fast it doesn't collide.
set [Health v] to [0]
show
forever
if <(Health) < [0]> then
change [Score v] by [1]
delete this clone
end
end
- Discussion Forums
- » Help with Scripts
-
» why are some of my enemies invincible

