|
| 01 Jan 2014 07:31 PM |
| The Died event doesn't give me enough information. I need to know who shot the player. Or how the player died. Does anyone have a thought on how this can be done? It's done quite frequently on many popular games. I'm not asking for a script, just advice, I can script it fine myself. I just don't know what to do. |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 01 Jan 2014 07:40 PM |
In your weapons script insert a stringvalue into the player who's shot and make the value the weapon's name (remove it after time) When the player dies, take the value (may be multiple, figure out a method to find last added) and do whatever |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 07:42 PM |
| That's a good idea. I might use a table to figure it out, and just find the lower value. Does the less than and greater than metamethods talking about the element's value or the index? I'll go check. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 07:42 PM |
Have damage sources add their information to the character, then on death check the information.
IE:
Player falls below -10 studs. Script adds a StringValue with a Value of 'fell' to their Humanoid and kills them DeathScript checks their Humanoid, finds the 'fell' value and says "Player fell to their death" or something.
IE:
Player is shot by Player2 Weapon adds an ObjectValue with Name set to total damage inflicted and a Value of the shooter to the Player's Humanoid. DeathScript checks their Humanoid, finds the ObjectValue, sees that the player has inflicted the most damage to them and says "Player1 was shot by Player2". |
|
|
| Report Abuse |
|
|
person725
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 535 |
|
|
| 01 Jan 2014 07:42 PM |
| Mother of telamon, its notunknown!!! |
|
|
| Report Abuse |
|
|
| |
|
person725
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 535 |
|
|
| 01 Jan 2014 07:43 PM |
| I hate being banned and having to use an alt e.e |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 07:44 PM |
| Nevermind my metatable stuff I just learned them and I am very eager to use them. The metamethods are for comparing tables and I don't even know why I thought I needed to use metamethods lol. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 07:44 PM |
| Oh thank you very much Notunknown |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 07:51 PM |
So Notunknown, this is what I'm thinking after reading what you said:
First off, I only care what happens if the player gets shot by another player, not if they fall because no matter what whenever they die their amount of deaths will be incremented. So would everyone had a string value in their humanoid or where ever in them and the most recent player to shoot another player will get their name on it so whoever shot the person last has their name on the value? |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 07:56 PM |
I was thinking more like this:
ObjectValue Value: The Player who inflicted the damage Name: A table (in JSON form) containing the weapons they damaged the player with, along with the amount of damage they inflicted. Like this:
{gun1=20, gun2=30, gun3=5} |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 08:00 PM |
| That's smart since you could do assists and have it say in a corner blah gun blah |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 08:02 PM |
| And the object value would be located inside of the humanoid? Why the humanoid? When the player dies does the humanoid get removed/destroyed, if so, the info is gone. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 08:05 PM |
| No it doesn't. I put it in the Humanoid out of convention, and because often there is not much else in there. If it makes you happier, instance a special Configuration in their model whenever they respawn and put the stuff there. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 08:09 PM |
| Actually, what you just said would make it much better. Then I could hold leaderboards for every game they have played for data persistence. |
|
|
| Report Abuse |
|
|
| |
|