how do i make my game so when a fireball blows up something it adds up points

how do i make my game so when a fireball blows up something it adds up points
please help

You should store the player’s gameobject into the fireball, and when DestroySomething() is called (which i assume is the function you call when you want your fireball to destroy something), you can call a function that adds points in a script in the player’s gameobject.
For instance: Fireball.js

var playerObject:GameObject;
function OnTriggerEnter(other:Collider){
DestroySomething(other.gameObject);
}

function DestroySomething(go:GameObject){

playerObject.GetComponent("PointsScript").AddPoints(go.GetComponent("PointsPointer").points); //assuming the gameobject has a script that tells it how many points to give the player.


//things related to destroying objects here.
}