Can't instantiate object [JS]

I am trying to Instantiate an object, but it is not going well.
This is the script I made. I honestly don’t know what is wrong with it.
Also if I click on my script I don’t get the option to choose a GameObject for the var Obstacles.
I use old references from my old projects and those work fine.

And, yes I did named my spawnpoints SpawnPosition1, SpawnPosition2 and Spawnposition3 in the Hierarchy.
but it keeps saying Unknown identifier:‘SpawnPosition1’ or 2,3.

var Obstacles : GameObject;

InvokeRepeating("TheSpawner", 0, 1.0);

function TheSpawner()			
{				
var Spawn1 = GameObject.Find("SpawnPosition1");
var Spawn2 = GameObject.Find("SpawnPosition2");
var Spawn3 = GameObject.Find("SpawnPosition3");

var Spawn = Random.Range(0,2);

if(Spawn == 0){
  Debug.Log("1+2");
Instantiate(Obstacles, SpawnPosition1.transform.position, Quaternion.identity);
Instantiate(Obstacles, SpawnPosition2.transform.position, Quaternion.identity);
}
if(Spawn == 1){
  Debug.Log("1+3");
Instantiate(Obstacles, SpawnPosition1.transform.position, Quaternion.identity);
Instantiate(Obstacles, SpawnPosition3.transform.position, Quaternion.identity);
}
if(Spawn == 2){
  Debug.Log("2+3");
Instantiate(Obstacles, SpawnPosition2.transform.position, Quaternion.identity);
Instantiate(Obstacles, SpawnPosition3.transform.position, Quaternion.identity);
}
}

Thx, hope you can help me.

So you named your gameobjects “SpawnPosition1”, “SpawnPosition2” etc. in the scene hierarchy.
But (on lines 7-9), you name your variables “Spawn1”, “Spawn2” etc.

So:

Instantiate(Obstacles, SpawnPosition1.transform.position, Quaternion.identity);

will cause an error. You meant:

Instantiate(Obstacles, Spawn1.transform.position, Quaternion.identity);

I’m unable to schedule an object to him being the starting point of a ship shot. It is giving error in the code, who could help me? the code is this:
using UnityEngine;
using System.Collections;

public class atirardor: {MonoBehaviour

char = Transform shot;
void Start () {

}

// Update is called once per frame
void Update () {

if (Input.GetKeyDown (“z”)) {
Instantiate (shot transform.position, transform.rotation);
}
}
}