SolidBanana117
This is minecraftcrazy1998 who needs your help. Could you help me with making health for my zombie game because when i do it, it glitches.
Offline
I think you need to explain a little more of what your game is like. What you can do is when a zombie attacks you, you change te costume of your health bar sprite which would lower it. This script could go in the health bar.
When I receive [i just got hurt] Next costumeThen make a script like this:
When gf clicked Wait until <<costume # [1] of [health bar]> = [1]> Stop allI'm not sure if this would work. I don't know if you can make it so if costume 1 = 1.
Last edited by turkey3 (2012-03-16 20:15:06)
Offline
turkey3 wrote:
I think you need to explain a little more of what your game is like. What you can do is when a zombie attacks you, you change te costume of your health bar sprite which would lower it. This script could go in the health bar.
When I receive [i just got hurt v] Next costumeThen make a script like this:When gf clicked Wait until <<[costume # v] of [health bar v]>=[1]> Stop allI'm not sure if this would work. I don't know if you can make it so if costume 1 = 1.
Fixed it a bit
Offline
you could make a variable, sorta like: [health (5)] then do like: when I receive: Ouchies I got a boo boo!!!!!! (AKA: OMG a zombies biting me!), change [ouchies I got a boo boo!] by (-1).
Offline
If you want to make health and death happen when health=0, try these following scripts:
when gf clicked set [health] to (5) endThat's just to reset the zombie's life every time. then do:
when I receive [zombie hit] change [health] by (-1) endthis will make it so that the zombie will lose health whenever it gets hit. then do this:
when gf clicked forever if <(health) = [0]> brodcast [zombie dead] endthis wiull make the zombie die when it loses all health.
Offline