Get variable from other GameObject's script

I tried to get the variable nbullet from the script Control of the GameObject Player, I wrote this script:

using UnityEngine;
using System.Collections;

public class Info : MonoBehaviour {

public int nbullet;
public GameObject player;
void Start () {
}
void Update () {
    player = GameObject.Find("Player");
    nbullet = GetComponent("Control").nbullet;
    }
}

but it tells me this error:

Assets/Info.cs(29,52): error CS1061: Type UnityEngine.Component’ does not contain a definition for nbullet’ and no extension method nbullet’ of typeUnityEngine.Component’ could be found (are you missing a using directive or an assembly reference?)

why? how can I fix this?

If the nbullet variable is public you just have to cast the Component to the script like this:

var controlscript : Control = player.GetComponent("Control");
nbullet = controlscript.nbullet; //You should also consider renaming your nbullet variable

I’ve spotted the issue. Everything is correct except for line 12. You wrote nbullet = GetComponent("Control").nbullet. This is almost correct. You forgot to GetComponent from the player, and I think the GetComponent could potentially have incorrect syntax. So it should be more like this: nbullet = player.GetComponent<Control>().nbullet;

You should learn how to use this site. This has many answers all over the place.

Also look there: unitygems.com - unitygems Resources and Information.
Having scripts interact - Questions & Answers - Unity Discussions