in robloxs kills and wipeouts leaderboard script they detect it like this
function getKillerOfHumanoidIfStillInGame(humanoid)
-- returns the player object that killed this humanoid
-- returns nil if the killer is no longer in the game
-- check for kill tag on humanoid - may be more than one - todo: deal with this
local tag = humanoid:findFirstChild("creator")
-- find player with name on tag
if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then -- killer still in game
return killer
end
end
return nil
end
does roblox somehow detect the player that kills someone and automatically insert an objectvalue of the killer in that persons humanoid?
nowhere else in the script is creating this value
|