of     1   

ChefJustice
#139840855Thursday, July 10, 2014 4:35 AM GMT

script.Parent.Enemy.Died:connect(function(player) print (player.Name) end) This is a script from inside one of my enemies. How could I locate the player who killed the enemy? ~egmen
AnonyAnonymous
#139841478Thursday, July 10, 2014 4:41 AM GMT

There's multiple methods to doing this actually, you could parent the projectile to the Tool that created it and use that to store the Name of the LocalPlayer in a StringValue.
AnonyAnonymous
#139841554Thursday, July 10, 2014 4:42 AM GMT

Actually, that wouldn't work.
robloxthebook
#139846156Thursday, July 10, 2014 5:26 AM GMT

Not sure what you're trying to do here, but I'll give it a go. game.Players.PlayerAdded:connect(function(noob) noob.Died:connect(function() print(noob.Name) end) end)
MHebes
#139846509Thursday, July 10, 2014 5:30 AM GMT

Do what ROBLOX does to keep track of KOs ingame. Every time a weapon causes damage, check to see that the Humanoid is not dead yet and if not, insert an ObjectValue into the humanoid with the Value equal to the owner of the weapon (this is all in the weapon's script). Make the 'tag' have a unique name and have it remove itself after a second or two. Then, in whatever script is keeping track of a Humanoid dying, check for these little 'tags' that tell you who last caused damage to the Humanoid before it died. The Value of that tag is your killer.

    of     1