Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Killstreak board not showing?

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)

1 answer

In line 6, you misspelled "leaderstats" to "leaderstas"

This discussion is preserved as it was. New answers, comments, and votes are closed.