add score to player's scoreboard after killing another player
I am using a health script (in javascript) that uses a health var and whe nit equals 0 instead of destrying the player it just teleports the player to it's spawnpoint and the health var it reset to 100, how do I add a score var to my script so it adds one point to the killer's score board only ?, the players are all using the same health script.
Here the script in javascript:
var SpawnPoint : Transform; var respawn : boolean = false; var health:float = 90;
function Damage(dmg:float){ health -= dmg; }
function Update (){ if(health <=0){ transform.position = SpawnPoint.position; var audio: AudioSource = GetComponent.(); audio.Play(); audio.Play(44100); health += 100; }
}
Your answer
Follow this Question
Related Questions
How can i get a scoring system? 1 Answer
How do I add a score system? 1 Answer
How do I randomly generate two obstacles in a 3D endless runner with 1 gap to go through? 1 Answer
How do I make the Score system work? 1 Answer
Object Reference not set to an instance of object / printing a variable from another scene 1 Answer