Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make your sprite die when hp reaches 0
- undertale_fan42069
-
11 posts
How to make your sprite die when hp reaches 0
Hello! Im making an undertale fight and i need to know how to make the soul die when the hp reaches 0
- PolySquare
-
56 posts
How to make your sprite die when hp reaches 0
So, I hope you have made a hp variable. If you have made, then death means to hide. So, you can use the following blocks to show the death of the sprite:
when green flag clickedThen, add the following blocks in the sprite to be dead:
forever
if <(hp) = [0]> then
broadcast [death v]
end
end
when I receive [death v]
hide
- Nezon
-
1000+ posts
How to make your sprite die when hp reaches 0
First, add a stop this block or it will forever broadcast death, and add a <(hp) < > because hp may go padt 0 like -1 to -10 So, I hope you have made a hp variable. If you have made, then death means to hide. So, you can use the following blocks to show the death of the sprite:when green flag clickedThen, add the following blocks in the sprite to be dead:
forever
if <(hp) = [0]> then
broadcast [death v]
end
endwhen I receive [death v]
hide
- PolySquare
-
56 posts
How to make your sprite die when hp reaches 0
ookFirst, add a stop this block or it will forever broadcast death, and add a <(hp) < > because hp may go padt 0 like -1 to -10 So, I hope you have made a hp variable. If you have made, then death means to hide. So, you can use the following blocks to show the death of the sprite:when green flag clickedThen, add the following blocks in the sprite to be dead:
forever
if <(hp) = [0]> then
broadcast [death v]
end
endwhen I receive [death v]
hide
- undertale_fan42069
-
11 posts
How to make your sprite die when hp reaches 0
it didnt work for me
- SaltyTree
-
100+ posts
How to make your sprite die when hp reaches 0
when green flag clicked
forever
if <(hp) < [1]> then
...
end
end
- PolySquare
-
56 posts
How to make your sprite die when hp reaches 0
when green flag clicked
forever
if <(hp) < [1]> then
hide
end
end
- Ankit_Anmol
-
500+ posts
How to make your sprite die when hp reaches 0
this is correc5when green flag clicked
forever
if <(hp) < [1]> then
Die :: grey
end
end
- undertale_fan42069
-
11 posts
How to make your sprite die when hp reaches 0
could you provide a game where this worked?
- randomguy3513
-
1000+ posts
How to make your sprite die when hp reaches 0
heres a better workaround
if your using costumes numbers to track your health then use this script
this is a much better one So, I hope you have made a hp variable. If you have made, then death means to hide. So, you can use the following blocks to show the death of the sprite:when green flag clickedThen, add the following blocks in the sprite to be dead:
forever
if <(hp) = [0]> then
broadcast [death v]
end
endwhen I receive [death v]
hide
if your using costumes numbers to track your health then use this script
when I receive [damage v]if your using a varibles to track your health then use this
next costume
if <(costume [number v] :: looks) = (10)> then
broadcast [gameover v]
end
when I receive [damage v]
change [health v] by (-1)
if <(health) = (0)> then
broadcast [gameover v]
end
- Discussion Forums
- » Help with Scripts
-
» How to make your sprite die when hp reaches 0