I know some people have already made guides on this but it is a bit different than the other guides.
Step 1.
Get a property device and set the property name to “Lives” and the type to number, set “Does this property count as changed when the game starts?” to yes. Get a counter device and make it make it aline with the “Lives” property, make the starting value the amount of lives you want the player to have.
Step 2.
Get a lifecycle and make the type “when player knocked out” and make it broadcast “lose life” Get the Game overlay device and set the type to text. Set the background color to red (optional). Then, go into blocks and make a new block for for channels, make the channel “lose life”. Follow the image below for the blocks.
Step 4.
Get a end game device and make it so it ends the game on channel “Out of lives”
Then go into the game overlays block and add:
If [get property(Lives)] equals [(0)] then
broadcast on channel [Out of lives]
This is my first guide so please forgive me if there are some bugs, comment what bugs you find please!