i need to get from weapon script ammo ant send to gui script
Line of weapon script:
var ammo = 30;
AmmoLeft.bullet == Ammo;
Gui script:
var bullet;
function Update () {
guiText.text = "" + bullet;
}
And i get error:
Assets/New Folder/all weapon shit/Weapon.js(23,10): BCE0020: An instance of type 'AmmoLeft' is required to access non static member 'bullet'.
Sorry for bad ENGLISH 
How i can solve this error?
if your trying to see how much ammo you have left then use try script.
var bulletGUI : GUIText;
// Update machine gun gui
// Machine gun gui is simply drawn with a bullet counter text
if (machineGun) {
bulletGUI.text = machineGun.GetBulletsLeft().ToString();
}
}
I havent use it yet. I edited it out of the FpsPlayer script.
How i can show all my ammo in GUI Text?
i need to get from script 1 my ammo var ant send them to script 2
Script 1 is my weapon script
script 2 is my gui script 
don’t use the script it doesnt work
From the error message, it seems you made scripts but you didn’t attach them to objects. And because they are normal variables, they must be attached to an object before being accessed.
The right order is : gameObject - component - variable.
So, a gameObject called WeaponAlpha, with a javascript component called FiringAbility, and a variable inside called ammunition…
GameObject.Find ("WeaponAlpha").GetComponent (FiringAbility).ammunition
If you have two weapon, WeaponAlpha and WeaponBeta, each component is unrelated, and their Ammunition value may be different during time.
If Ammunition was static, it means you don’t need to put FiringAbility on a gameObject, you can simply say : FiringAbility.ammunition. But this value will be common to all FiringAbility scripts on gameObjects, so use it with caution for specific items, you don’t want the ammunition left of WeaponAlpha be the same variable as WeaponBeta’s.
http://unity3d.com/support/documentation/ScriptReference/index.Member_Variables_26_Global_Variables.html
-
When you declare variables, add their type.
var Ammo : int = 30;
var Clip : int = 4;
-
Then…Line 22 of Weapon.js … you didn’t tell which object has AmmoLeft.Bullet. In your case, it’s the gameObject “GUI Text”. So, correct your line to have GameObject.Find “GUI Text”.AmmoLeft.Bullet.
Note : I hope you know what you’re doing. Are you doing / Have you done the FPS tutorial of Unity ? If no, well…