Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
xfukecx

Scoreboard(Photon)

Question

Hello!

 

I am working on a multiplayer fps game. I'm trying to make a scoreboard for it, I've done it so it shows all the players connected. Now I'm stuck, i dont know how i can make a kill counter, the health script knows ho was the last hitter, but how can i make it so that this player gets a kill? 

 

Sorry for my bad english

 

xfukecx

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

"The answer depends on how you send the shots in the first place.
I assume you use RPC? Then you can add a last parameter to your RPC method to get the necessary info.
Make your RPC: Shot(..., PhotonMessageInfo mi) and access the sender of an RPC via mi.sender.

You will find the reference documentation for PhotonMessageInfo in the package documentation .chm file and here:
Please login or register to see this link. "

 

Quoted from: Please login or register to see this link.

 

Already been answered please check the official unity forums and photon forums before posting as there is literally endless posts identical to this :)

Share this post


Link to post
Share on other sites

  • 0

I did this, 

I added the string LastShotBy, to my health script.

Then on my shooting script I send a RPC to my health script, and if the health = 0, it says who was the last hitter. But I dont know how i can make it so the player that hitted the other person last, would get the kill.

Share this post


Link to post
Share on other sites
  • 0

oh, sorry my bad

 

use the custom properties, e.g

 

new property kill = custom property kill +1;
custom property kill = new property kill;

 

the logic is pretty much the same as how you got the list of players in game, code gets called, update the table :)

Share this post


Link to post
Share on other sites
  • 0

okay, its hard to know how you would integrate it without seeing your code, but it goes a little like this:

Please login or register to see this code.

psuedo code, might not work by drag and drop

Share this post


Link to post
Share on other sites
  • 0

i know how to make a scoreboard, but first I have to make, that player gets a kill added when he kills someone.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...