2D bullet script to shoot in the direction the character is in

As I write this I know that this may be a duplicate but none the others worked for me. I am basically trying just to shoot a bullet that would move foward in the direction of the player. I remember it being really easy to do in 3D but for some reason nothing works for my 2D game. The character does not move, just stay in the same spot and rotates by looking at the mouse. I made my script seperate from the instantiate script. Here is my script.

var BulletSpeed = 5;
static var explosion = false;
function Start () {

explosion = false;

}

function Update () {

transform.Translate(Vector3.forward * BulletSpeed);

}
function attackcooldown () {

for (var x = 1; x < 2; x++) {
yield WaitForSeconds(4);

}

Vector3.forward is the same thing as Vector3(0, 0, 1), so the bullet will always move in the same global direction. You want something like

var Player : GameObject;

function Start () {
	transform.forward = Player.transform.forward; 
}
 
function Update () {
	transform.Translate(transform.forward * BulletSpeed * Time.deltaTime);
}

Also, this is unrelated but since your explosion variable is static, you should not initialise it in the Start method which is not static.

static var explosion = false;

This line is enough.