|
| 04 Jan 2013 09:03 PM |
How do you check who the killer of a humanoid was?
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 09:11 PM |
Game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) Character.Humanoid.Died:connect(function() if Character.Humanoid:findFirstChild('creator') and Character.Humanoid:findFirstChild('creator').Value then local killer = Character.Humanoid.creator.Value; print(killer.Name..' has killed '..Player.Name); end end) end) end) |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 04 Jan 2013 09:13 PM |
@epic does a player's humanoid already have that value? or is it from a leaderboard? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 04 Jan 2013 09:15 PM |
Most weapons insert that ObjectValue into the Humanoid.
print("NOU.floodCheck") |
|
|
| Report Abuse |
|
|
| |
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
| |
|
|
| 04 Jan 2013 09:17 PM |
| About 99% of weapons/tools have code in them that transfers an object value holding the player object of the shooter of the tool that transfers the object value to the humanoid of the player it hit, giving that specific player a 'tag' of the person that is shooting at them. Hope that made sense. |
|
|
| Report Abuse |
|
|
| |
|