I have a script that saves a player's leaderstats for how many kills that player has achieved. Here's the script:
game.Players.PlayerRemoving:connect(function(player)
local s = player:findFirstChild("leaderstats")
if s then
local k = s:findFirstChild("Kills")
player:SaveNumber("kill", k.Value)
end
end)
game.Players.PlayerAdded:connect(function(player)
if player:WaitForDataReady() then
player:LoadNumber("kill")
end
end)
The problem is that the script doesn't do anything. I tried putting print("check") in both lines of code and nothing showed up in the output. Any help?
