How can I manipulate the script attached to a Transform Object?

I have been using a script that controls elements in the scene as Transform objects.
Those objects have a javascript,and are within a GameObject.

I have found some trouble when I want to access their script, because what I have found, only works for GameObjects, not for Transform.

can you give me an idea howo to solve this?
in code, or reoganizing my code

thanks

I have something like this

player script:

var health = int;
health=100;

enemy script:

 var target : Transform;    // I place my player here in the editor
var playerHealth= GetComponent(CameraControlPlayer).health;
if(playerHealth>10)
atack();

on the enemy script, I am not able to read or manipulate the values or variables from player(Transform) script.

u need to do a

public static var health = int;

in order to access the var.

That line

var playerHealth= GetComponent(CameraControlPlayer).health;

is actually

var playerHealth = this.GetComponent(CameraControlPlayer).health;

Which means it’s going to return the component CameraControlPlayer attached to the same gameObject this script is attached to. So, it will return null. Try

var playerHealth = target.GetComponent(CameraControlPlayer).health;

@kingk614: yes that solved my problem. what I wrote at the end was:
public static var health = int;
health=100;
enemy script:

var target : Transform; // I place my player here in the editor
var playerHealth= target.GetComponent(CameraControlPlayer).health;
if(playerHealth>10)
atack();

also if you ever wanted a access more from that script you should do something like this:

//C#
public GameObject ScriptObject;
public ScriptName SomeName;

//in the update()
SomeName = ScriptObject.GetComponent<ScriptName>();
//u can now use the SomeName variable to access any 
//public variable or function from ur script.

//Java Script
public ScriptObject : GameObject;
public SomeName : ScriptName;

//in the update()
SomeName = ScriptObject.GetComponent(ScriptName);
//u can now use the SomeName variable to access any public 
//variable or function from ur script.

Hope this helps you.