Hello! The script below will successfully add points to my leaderboard after a player first kills another player. But, if they kill more, the points will not exceed the values below. Or if they exceed it once, like when the player is awarded points for surviving the round, the very next round when they kill another player, it reverts back to the values below. How can I make the values increase per kill? Thank you!
Players = game:GetService('Players') Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) local Humanoid = Character:WaitForChild('Humanoid') Humanoid.Died:connect(function() if Humanoid:FindFirstChild('creator') ~= nil then local Killer = Humanoid.creator.Value Killer.leaderstats.Points.Value= Player.leaderstats.Points.Value+100 Killer.leaderstats.EXP.Value= Player.leaderstats.EXP.Value+350 end end) end) end)
Hello, Never2Humble!
Before, I used to have that same issue, and I solved it myself. I'll share with you my personal script, of earning Points/XP for each kill.
game.Players.PlayerAdded:connect(function(newPlayer) local humanoid = script.Parent.Humanoid script:clone().Parent = humanoid.Parent function PwntX_X() local tag = humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local leaderstats = tag.Value:findFirstChild("leaderstats") if leaderstats ~= nil then leaderstats.Credits.Value = leaderstats.Credits.Value + 5 leaderstats.EXP.Value = leaderstats.EXP.Value + 5 wait(0.1) script:remove() end end end end humanoid.Died:connect(PwntX_X)
If it does not work, Please feel free to ask!