Spawning is enabled every x amount of seconds

Hello, what I want to do is that I can spawn objects every x amount of seconds with button (Spawning is not enabled while waiting for the seconds to pass)
Here is my current script:

var objectsToSpawn : Transform[];
var spawnPoint : Transform;

function Update() {
    
    if (Input.GetKeyDown("t")){
    Instantiate (objectsToSpawn[(Random.Range(0, objectsToSpawn.Length))], spawnPoint.position, Random.rotation);
    
    }
}

The GUI box with the counting seconds and with telling me how much times can I use a spawn would be also cool :slight_smile:
Something like if x amount of seconds is passed, spawn times +1.
Thanks!

this is Unityjava

:smile:

Not working :confused:
No errors, just won’t work.