From the killer
If you kill Player 1, Player 2 will get a point. If the points awarded are based on the player’s proximity to the killed player, then this is incorrect.
You must use the tagging system in the weapon
This code when placed inside a Script in StarterPlayer in StarterCharacterScripts
local humanoid = script.Parent:WaitForChild("Humanoid")
humanoid.Died:connect(function()
local tagging = script.Parent:FindFirstChild("CreatorKill")
if tagging ~= nil then
if tagging.Value ~= nil then
local Leaderstats = tagging.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.Kill.Value = Leaderstats.Kill.Value + 1
Leaderstats.Coins.Value = Leaderstats.Coins.Value + 10
script:Destroy()
end
end
end
end)
This code is when placed inside a script in the Weapon Kill function
local tagging = Instance.new("ObjectValue")
tagging.Value = dealer
tagging.Name = "CreatorKill"
tagging.Parent = target.Parent
game:GetService("Debris"):AddItem(tagging,.5)
I used this system in a game that I play with my friends