How to make a stud kill log?

You can use a tag to get which player killed another player and check magnitude to get the studs.

humanoid.Died:Wait()
local tag = humanoid:FindFirstChild('creator')

if tag and tag.Value then
    local distance = (char.HumanoidRootPart.Position - tag.Value.Character.HumanoidRootPart.Position).Magnitude
    local rounded = math.floor(distance / 10) * 10 -- so it isnt something like 1.1234567891234
    print(player.Name .. ' was killed by ' .. tag.Value.Name .. ' ' .. rounded .. ' studs away.')
end
1 Like