So there was a problem, for some whatever reason, the killstreak board wouldn't appear, The output also said there wasn't a problem
Script:
local DSS = game:GetService("DataStoreService"):GetDataStore("Kills")
game.Players.PlayerAdded:Connect(function(player)
local LS = Instance.new("Folder",player)
LS.Name = "leaderstas"
local Kills = Instance.new("NumberValue", LS)
Kills.Name = "Kills"
local key = player.UserId.."-Kills"
local data
pcall(function()
data = DSS:GetAsync(key)
end)
if data then
Kills.Value = data[1]
else
Kills.Value = 0
end
player.CharacterAdded:Connect(function(char)
char.Humanoid.Died:Connect(function()
Kills.Value = 0
local creator = char.Humanoid:FindFirstChild("creator")
if creator and creator.Value then
local plrkilled = creator.Value
local killsValue = plrkilled.leaderstats.Kills
killsValue.Value = killsValue.Value +1
end
end)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
local key = player.UserId.."-Kills"
DSS:SetAsync(key, (player.leaderstats.Kills.Value))
end)
