Need help figuring how to add more time to timer

Hi everyone, I’ve done a lot of revising to my scripts here:

static var initiated = false;

function OnTriggerEnter (col : Collider) {
    if( == "Player")     

    gunscript.initialSpeed += 50;
    initiated = true;

    if(initiated == true) 

    SpeedPowerup1.timerStarted = true;  
    initiated = false;   

var barDisplay : float = 3;
static var timeLeft : float = 15;  //amount of time on timer
static var gunSpeedReduced = false;
static var finishTimer = false; //i made this global so you can access from other scripts
static var timerStarted = false;

function Update() {
    if(timerStarted == true) {
        timeLeft -= Time.deltaTime;
    if(timeLeft <= 0.0f) {
        timerStarted = false;
    if(timerStarted == false && timeLeft <= 0.0f) {
function Activate() { 
    if(timeLeft > 0.0f && gunSpeedReduced == true)
        gunSpeedReduced = false;  
    else if(timeLeft <= 0.0f && gunSpeedReduced == false)
        gunscript.initialSpeed -= 50;
        gunSpeedReduced = true;

The problem I am having is that when I collide with a gameobject with the first script attached and the timer runs out, it isn’t resetting if I collide with another gameobject with that same script attached.

Also, I want to have it so that if I collide with two or more game objects with that same script attached, I want the amount of timeLeft to be added to any remaining time already being counted down.

I hope this makes sense and any input or help is greatly appreciated.

timeLeft was declared as static, so it’s created once and is unique - all scripts will write/read the same timeLeft. If you remove the static keyword, timeLeft will be a “script stuff”: it will exist in each script instance. This will solve your first problem.

I didn’t get what you want to do when colliding with more than one of these objects; can you give an example?