JS to C# Need some help.

if(ammo > 0)
{

		ammo --;
		var projectile = Instantiate(shot, transform.position, Quaternion.identity);
		projectile.rigidbody.AddForce(transform.forward * 1500);
		}

JS code

if(ammo > 0)
			{
			
			
		ammo --;
		var projectile = Instantiate(shot, transform.position, Quaternion.identity);
		projectile.rigidbody.AddForce(transform.forward * 1500);
		}

C# code

why does it not work?

theres something wrong with the rigidbody in c#

The reason is that in C# Instantiate returns an object of type Object, the top class of all. It is required to cast the object to the appropriate type:

Type t = (Type) Instantiate();

In your case:

GameObject projectile = (GameObject)Instantiate(shot, transform.position, Quaternion.identity);