I am trying to make a simple if statement that sees if the player is near fire. If he is near the fire and the key is not pressed he would receive damage as indicated. This works perfectly. However if the key is pressed the player will still be receiving damage.
if (Vector3.DistanceSquared(Game.LocalPlayer.Character.Position, locationData.GoToPosition) < 10f)
{
if(Game.IsKeyDown(Settings.SCBA) == false)
{
Game.LocalPlayer.Character.Health -= 1;
}
else
{
Game.LocalPlayer.Character.IsFireProof = true;
}
}
Aucun commentaire:
Enregistrer un commentaire