help with this point system

So i have made this game where you knock things over and you get points for them. these points update in a GUI counter thing i created. but the problem is that once i knock things over they never stop giving points, and the counter goes up endlessly. how can i make it so that once a table or a chair hits the ground it gives me 10 points and then stops?
here is some script relevant to what im trying to accomplish.

#‎pragma‬ strict
var Score = 0;
var guiFont : int = 10;
var moneySound : AudioClip;
function Start () {
}
function Update () {
}
function OnGUI () {
GUI.Box (Rect((Screen.width/2)*0.03, (Screen.height/2)*0.03, 130,35), "Score: "+ Score);
GUI.skin.box.fontSize = guiFont;
}
function OnControllerColliderHit(hit : ControllerColliderHit) {
if(hit.gameObject.name == “money”) {
Score += 10;
//print(Score);
audio.PlayOneShot(moneySound);
Destroy(hit.gameObject);
}
if(hit.gameObject.tag == “ThrowStuff”) {
Score += 10;
//print(Score);

}
}

thanks!

You could perhaps turn off the collider. What is happening it seems is that the collision occurs over and over again and again.

Under the concept, you should have the money give points, rather than giving points for touching things.

Secondly, you should have a physics based controller rather than a numeric based controller. This will allow you to do physics things.

Without knowing exactly what you are doing, it will be hard but from what you have you are trying to give points from an object that is no longer on the same side that it started as. Lastly, I would make that object be destroyed if it has been used, since you don’t want that object to roll around and bust other objects giving more points. (or maybe you do).

#pragma strict

var pointsGiven : int = 1;
private var pointController : PointController;
private var rotation : Quaternion;
private var scored : boolean;


function Start(){
	pointController = GameObject.FindGameObjectWithTag("Player").GetComponent(PointController);
	rotation = transform.rotation;
	
}

function Update(){
	if(scored) return;
	if(Quaternion.Angle(transform.rotation, rotation) > 30){
		pointController.points += pointsGiven;
		Destroy(gameObject, 5); // destroy this after 5 seconds.
	}
}

Lastly, Please use Code tags when presenting code. :wink: