generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Finding how a player died

Previous Thread :: Next Thread 
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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 is not online. 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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
01 Jan 2014 07:42 PM
Mother of telamon, its notunknown!!!
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
01 Jan 2014 07:42 PM
Huh?
Report Abuse
person725 is not online. 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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
01 Jan 2014 07:44 PM
Oh thank you very much Notunknown
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
01 Jan 2014 08:10 PM
with data persistence
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image