Take boolean from other script error

I know there is alot of threats about taking booleans from other scripts, but mine just seem to dont work as it should and i cant find the mistake for myself. I have a flashlight attached to first person controller named flashlight.js

var on : boolean = false;

function Update() {
	if (zibintas.paimtas == true) { //will check if true
    	if(Input.GetKeyDown(KeyCode.F))
    	    on = !on;
   		if(on)
	        light.enabled = true;
		else if(!on)
  	     	light.enabled = false;
	}
}

and i have an object named zibintas with script named zibintas.js attached to it :

static var paimtas : boolean = false;

var player = GameObject.FindGameObjectWithTag("Player");

 function OnTriggerEnter (player : Collider) {
	if(player.tag=="Player") {
	if (paimtas == false) {
	paimtas = true;
	GameObject.Find("zibintas");
	Destroy (gameObject);
    }
	}
	}

I need for flashlight to check if zibintas boolean named paimtas == true; and if true, the flashlight should work normaly but if i write the line if (zibintas.paimtas == true) it just doesnt do anything even tho paimtas changes to true;

You need to define what zibintas is in the flashlight.js script first, otherwise zibintas is just pointing to an empty variable.
Probably the easiest way is to link the zibintas object to the flashlight.js in the inspector and then access the paimtas variable.

var on : boolean = false;
var script : zibintas; //this name must exactly match the name of the script
 
function Update() {
    if (script.paimtas == true) { //will check if true
        if(Input.GetKeyDown(KeyCode.F))
            on = !on;
        if(on)
            light.enabled = true;
       else if(!on)
             light.enabled = false;
    }
}