Simple point system

static var score = 0;
var scoreDisplay: GUIText;

function Update(){
    scoreDisplay.text = score;

so when i click on the coin i get +1 point to tatal score

So the basic question is ‘How Do I Detect A Mouse Click On An Object’ more than ‘How Do I Create A Point System’.

To find out if anything is hit, you perform a ‘RayCast’ - this basically traces a line in your scene to find out if it strikes any objects.

Luckily, your camera has a handy function to calculate the ray from a mouse position

This code is in C#, but it’s relatively easy to convert to Javascript - you won’t need the ‘Out’ parameter though

RaycastHit ObjectHit;

Ray MouseClickRay = Camera.ScreenPointToRay(Input.mousePosition);

Physics.Raycast(MouseClickRay,out ObjectHit);

This code creates a variable to store the item that has been hit, then creates a ray from where the mouse click occured on your main camera, and then traces it through the scene to find where it collides with game objects.

You can then use the ‘ObjectHit’ variable (which is a GameObject itself - so you can check it’s layer, tag or name to figure out if it’s a target). If it’s a target, you can increment your score and destroy the object.