I already have a simple script done that would track down kills and give weapons. The problem is that I don't know how to specific if a player has an amount of kills. I want the player to have 1 kill before getting the GLOCK 17. And yes, I already have my leaderboard setup.
local player = game:GetService("Players").LocalPlayer
player.leaderstats.Kills.Value = 1 --what to do with this line?
game.ServerStorage.Guns["GLOCK 17"]:Clone().Parent = player.Backpack
print("script success")
EDIT: I made a new script based off of CodeOverload's suggestions but I don't know why it's not working. Note that the game I am making runs like this: Someone kills a person, they gain a better weapon. I grabbed a quick death and kills script free model that works.
local player = game:GetService("Players").LocalPlayer
if player.leaderstats.Kills.Value == 1 then --tracks the player's kills
game.ServerStorage.Guns["USP-S"]:Clone().Parent = player.Backpack --gives gun
print("usp-s") --just to make sure you get the gun
if player.leaderstats.Kills.Value == 2 then --tracks player's kills
player.Backpack["USP-S"]:Destroy() --destroys previous gun
game.ServerStorage.Guns["Beretta"]:Clone().Parent = player.Backpack --gives gun
print("beretta") --just to make sure you get the gun
end
end

1 comment
On line 2, you're setting the value of "Kills" to 1 instead of checking if it's 1. Use an conditional statement to check or better yet, connect a function to the Changed() event and then put a conditional in there.