So I've been reading Tim Sweeneys overview of UScript and in the Conditional Statements section Sweeney gives this example of a "if-else if-else" statement:
So I wanted to try that out, but instead of LightBrightness I wanted to log when the Health hits a certain level:
When I use this mut the only log that I get is "My health is very high". The others don't give the logs when my health reaches their level.
Can anyone tell me why this is happening?
Code:
if( LightBrightness < 20 )
log( "My light is dim" );
else if( LightBrightness < 40 )
log( "My light is medium" );
else if( LightBrightness < 60 )
log( "My light is kinda bright" );
else
log( "My light is very bright" );
So I wanted to try that out, but instead of LightBrightness I wanted to log when the Health hits a certain level:
Code:
class Law extends Mutator;
function ModifyPlayer(Pawn Other)
{
local xPawn n;
n=xPawn(Other);
if( n.Health < 20 )
log( "tweeeeeeeeenty" );
else if( n.Health < 40 )
log( "foooooooooorty" );
else if( n.Health < 60 )
log( "siiiiiiiiiiixty" );
else
log( "My health is very high" );
}
When I use this mut the only log that I get is "My health is very high". The others don't give the logs when my health reaches their level.
Can anyone tell me why this is happening?
Last edited: