The_Real_Olla
Member
Hey,
I am a noob and I am getting crazy because of simple "if" statment.
How come, below statement gets "true" more than once when I don't set global.playerdeath = 0 elsewhere?
If I put a counter inside of the brackets it continues to count even if global.playerdeath = 1. What am I doing wrong here?
if ((global.playerdeath = 0) and (global.playerhealth <= 0))
{
global.playerdeath = 1;
// Player explodes
}
I have also tried this:
if ((global.playerdeath == 0) && (global.playerhealth <= 0))
if (global.playerdeath == 0) and (global.playerhealth <= 0)
Any help on this is much appreciated!
I am a noob and I am getting crazy because of simple "if" statment.
How come, below statement gets "true" more than once when I don't set global.playerdeath = 0 elsewhere?
If I put a counter inside of the brackets it continues to count even if global.playerdeath = 1. What am I doing wrong here?
if ((global.playerdeath = 0) and (global.playerhealth <= 0))
{
global.playerdeath = 1;
// Player explodes
}
I have also tried this:
if ((global.playerdeath == 0) && (global.playerhealth <= 0))
if (global.playerdeath == 0) and (global.playerhealth <= 0)
Any help on this is much appreciated!
Last edited: