This is actually from ROBLOX's built in tools originally.
There is a convention for marking who bloxxed who with a weapon. This convention exists because it is what the servers look at to keep track of KOs and WOs on your ROBLOX profile.
When someone dies, before their character gets cleaned up, an ObjectValue named creator
is put into the dead character's Humanoid. The object value points to the person who did the killing of that character.
This method does all that-- it appropriately marks the VictimHumanoid
as being killed by Attacker
. It tags (as in marks) the dead with their killer which is why it's called CreateTag
.
The way it does that is first deleting any children of the Humanoid that are named "creator"
(lines 02 to 06).
It then creates a new ObjectValue (line 07) and names it "creator"
(line 09), puts it in the dead humanoid (line 08) and says who did it by setting the value's Value to the attacker (line 10).