I want make kill for money script but it don't give me money if I kill someone Here is script:
function onPlayerEntered(newPlayer)
local stats = Instance.new ("IntValue")
stats.Name = "leaderstats"
stats.Parent = newPlayer
local Money = Instance.new ("IntValue")
Money.Name = "Money"
Money.Value = 0
Money.Parent = newPlayer.leaderstats
end
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("Money")
if killer ~= player then
kills.Value = kills.Value + 10
else
kills.Value = kills.Value - 1
end
end
end
end
game.Players.ChildAdded:connect(onPlayerEntered)

2 comments