simple score system

im sorry for this question but i must to ask. cause i tried many times.

can someone help me ? about simple score system ?

there will be a ball. when the ball touched the box. the counter will count 3 seconds. then score +1000 and levelup,

float score = 0;
int level = 0;

IEnumerator WaitThenScore(flaot waitTime)
{
    yield return new WaitForSeconds(waitTime);
    score += 1000;
    level++;
}

void OnCollision(Collision collision)
{
    if(however you determine that it is the box)
    {
        StartCoroutine(WaitThenScore(3));
    }
}

There you go.

Honestly, how hard can a scoring system be?

unity ANSWERS. someone ask someone answer…

use a gui system dude
sort of this way

static var score : int = 0;

function OnGUI () {
GUI.Box (Rect (10, 50, 90, 40), ("score: " + score));
}

then use an OnTriggerEnter function to update this var called score
how was my answer btw