pick up item and count up gui text

Hi, i have the following problem:

i wanna pick up a item called “butterfly” or “items” and i wanna count it up in a GUI Text. How can i make this?? I`m not a scripting pro. So maybe somebody can help me with a easy description!! Thanks!!

I not sure what you mean. Are you saying the character can collect items in the game and you want to show how many he’s got so far? If so, you can keep a variable in the character’s script that you increment every time an object is collected:-

var numObjects: int;
   ...

function Update() {
   if (gotNewObject) {
      numObjects++;  // This means "increase by one".
   }
}

Then, you can display this value using GUI.Label. To do this, you need to supply the onscreen rectangle where the text should appear and also the text itself. You need to call GUI.Label from the OnGUI function:-

var labelRect: Rect;

function OnGUI() {
   GUI.Label(labelRect, "Collected: " + numObjects);
}

If you “add” a number to a string, the number gets converted to text and then stuck on the end.

If this wasn’t what you meant then perhaps you can give some more explanation of what you are doing.

This is a duplicated post; i already answered in scripting forum yesterday.
I did a project example and i tried to send it by pm to psx2k, but the process failed; i don’t know the max size the forum allows me to upload.
So, tonight i will be posting the project in the forum and, if i have no success, i will upload it to a server.