Windows I need help with ammo system

I have tried to create a basic ammo system. My first tried had an if statement in an if statement, and after that failed, I switched to this, which also failed. When I press spacebar, no matter how many times I press it, it fires. I don't know what to do.

if (global.redPotionCount > 0)
{
redPotionFire = true;
}
else
{
redPotionFire = false;
}

if (charSpace and redPotionFire)
{
redPotionInstance = instance_create_depth(x, y, 0, obj_redPotion);
redPotionInstance.speed = 1.5;
redPotionInstance.gravity = .04;
redPotionInstance.direction = point_direction(x, y, mouse_x, mouse_y);
global.redPotionCount -= global.redPotionCount;
}
 
Top