put this inside of whatever function damages the player in your weapon:
local tag = Instance.new("ObjectValue",Humanoid) --Humanoid needs to be defined to the damaged humanoid
tag.Name = "creator" --most popular name for these kind of things
tag.Value = game.Players.LocalPlayer --reference to our player for when the humanoid dies
in a server script:
workspace.ChildAdded:connect(function(child) --when something gets added to the workspace
local Humanoid = child:FindFirstChildOfClass("Humanoid") --checks if the added thing has a humanoid
if Humanoid and Humanoid:FindFirstChild("creator") then --is the humanoid and the creator tag present ?
Humanoid.creator.Value.Kills.Value = Humanoid.creator.Value.Kills.Value + 1 -- replace this by the path to whatever value defines the amount of kills the killer has
--add the gui text changing stuff here
end
end) |