- Home /
Scoring System with Networking
My game is now good I can kill a player simply. But now I need a GUI Text object to display the ammount of players I killed. I know that I need a script that is the GUI script to desplay the text. And then the part of my player health has to be edited. If anyone need to see the networking player health script, tell me.
Felipe
If you have a script, that has variables, how hard can it be to display them in the GUI?
GUILayout.Label("$$anonymous$$ills: " + player.kills);
Answer by Calumcj · May 15, 2012 at 11:08 AM
SO if you have a working script that keeps track of kills then just use coding somthing like this.
function OnGUI () {
GUI.Label(Rect(10,20,100,50) "Kills: " + playerKills){ //playerKills being the var you set up like var playerKills : int = 0; }
hope this helps :)
}
So 'var player$$anonymous$$ills : int = 0;' has to be on the players health script. And then I have to add a 'function AddPoint()' and write a if statement, that if the player's health reached <0 then a point is added.
Your answer
![](https://koobas.hobune.stream/wayback/20220613071507im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Trying to sync score on multiplayer LAN game 0 Answers
Unity networking tutorial? 6 Answers
How to detect number of players in a room? 3 Answers
how can i use OnPlayerConnected ? 0 Answers
UNET. Ho to use different NetworkManager in offline and online scane? 0 Answers