Vaiable problem

Hi

I have problem with health variable. I’m making online FPS game and i’m using M2H player script which has those lines

	if(hp<0){
		theScoreBoard.LocalPlayerHasKilled();
		networkView.RPC("Respawn",RPCMode.All);
	}else{
		networkView.RPC("setHP",RPCMode.Others, hp); 
	}

It should work just fine, if health is smaller than zero then respawn, but instead it wont let HP go lower than 1. I have no clue why. If i put == instead of < it wont let health go to zero even if damage is 25 hp. Health goes like this then

100

hit
75

hit
50

hit
25

hit
25

hit
-25

Help please if you have any idea.
Thank you.

Since 0 isn’t less than 0 it is taking the next hit putting hp at -25 before being true.

It should be hp <= 0 I would think. It would appear to me there is a problem elsewhere if it is showing 25 twice then -25.

If i make it your way the health value wont go lower than 1, like it wont let player to die. But now im pretty sure too the problem isnt there.