I have a GUI button that I use as a switch. If the players life falls below 0 I want the game to check to see if the button is visible an if it is I want it to restore 50% of life(HP) then I want the button to become invisible. However if the button is not visible I want the player to die.
Code: ags
if(playerHP <= 0){
if(phinoxbuff.Visible == true){
phinoxbuff.Visible = false;
playerHP += 50;
}
else if(phinoxbuff.Visible == false)
{
CountDown.Stop();
Dave.SayAt(8, 167, 320,"Dave:Is this it?.");
adeath.Play(eAudioPriorityHigh);
Dave.Tint(204, 0, 0, 50, 100);
chris.Tint(204, 0, 0, 50, 100);
gameover.TweenTransparency(0.1, 100);
Dave.TweenTransparency(1.5, 100);
chris.TweenTransparency(1.5, 100);
aBoss1a.Stop();
gameover.Visible = true;
gameover.TweenTransparency(2.0, 0);
Wait(19);
RestartGame();
}
}
}