Invoke problem, can't manually reload

Hello, I’m making an FPS game, (right now just working on the player/gun, etc.) and I’m having a bit of a problem. I’m trying to make it so that the player can manually reload using the R key but only if the ammo is less than 7. I tried to do the following:

//This is in the Update Function:

if(Input.GetKeyDown(KeyCode.R && AmmoLeft < 7)) {
    Invoke("ManualReload", 0.5);
  }



//Then in the ManualReload function:

function ManualReload() {
//All of the reloading is here in the script
}

I’m not sure where I’m going wrong with this, can anyone help?

Thanks

You have put your logic for AmmoLeft < 7 as a parameter for your GetKeyDown function. That will not compile.

Just move one of the ) at the end to right after KeyCode.R:

if(Input.GetKeyDown(KeyCode.R) && AmmoLeft < 7) {
    Invoke("ManualReload", 0.5);
}