Error, class project

Everytime I input this code it says I have to enter a “;” after every word. Can someone fix this?

public var pickupPrefab:GameObject;
public var numberOfPickups:int = 2;
private var spawnPointList:GameObject[];
private var spawnIndexAvailableList:Array = [];
private var numberOfSpawnPoints:int;
function Awake()
{
    GameObject which this script is a Component of
    spawnPointList = gameObject.FindGameObjectsWithTag("SpawnPoint");
    numberOfSpawnPoints = spawnPointList.length;
    if (numberOfPickups > numberOfSpawnPoints)
        numberOfPickups = numberOfSpawnPoints;
    for (var i:int = 0; i < numberOfSpawnPoints; i++)
    {
        spawnIndexAvailableList *= true;*

}
for (var j:int = 0; j < numberOfPickups; j++)
{
SpawnPickup();
}
}
function SpawnPickup()
{
the list
var randomSpawnIndex:int = Random.Range(0, numberOfSpawnPoints);
while (!spawnIndexAvailableList[randomSpawnIndex])
{
randomSpawnIndex = Random.Range(0, numberOfSpawnPoints);
}
var spawnedPickupPosition:Vector3 = spawnPointList[randomSpawnIndex].transform.position;
var spawnedPickupRotation:Quaternion = spawnPointList[randomSpawnIndex].transform.rotation;
var spawnedPickup:GameObject = Instantiate(pickupPrefab, spawnedPickupPosition, spawnedPickupRotation);
that this script is a Component of pickupPrefab to call functions within this sript
spawnedPickup.transform.parent = spawnPointList[randomSpawnIndex].transform;
spawnedPickup.name = randomSpawnIndex.ToString();
spawned in this position
spawnIndexAvailableList[randomSpawnIndex] = false;
}

This is the most ineffective and dangerous way to pick random spawn points.

This is a simplified and more robust version and furthermore doesn’t contain errors :wink:

import System.Collections.Generic;

public var pickupPrefab : GameObject;
public var numberOfPickups : int = 2;
private var spawnPointList : GameObject[];
private var availableSpawnPoints : List.<GameObject>;

function Awake()
{
    spawnPointList = gameObject.FindGameObjectsWithTag("SpawnPoint");
    // create a dynamic copy of the spawnpoint array
    availableSpawnPoints = new List.<GameObject>(spawnPointList);
    
    if (numberOfPickups > availableSpawnPoints.Count)
        numberOfPickups = availableSpawnPoints.Count;
    for (var j = 0; j < numberOfPickups; j++)
    {
        SpawnPickup();
    }
}

function SpawnPickup()
{
    if (availableSpawnPoints.Count <= 0)
        return; // No more spawnpoints left
    var randomSpawnIndex : int = Random.Range(0, availableSpawnPoints.Count);
    var spawnPoint : Transform = availableSpawnPoints[randomSpawnIndex].transform;
    // remove this spawn point from the available list
    availableSpawnPoints.RemoveAt(randomSpawnIndex);
    
    var spawnedPickup:GameObject = Instantiate(pickupPrefab, spawnPoint.position, spawnPoint.rotation);
    
    spawnedPickup.transform.parent = spawnPoint;
    spawnedPickup.name = randomSpawnIndex.ToString();
}