Stop data store from being on leaderboard

hi i made two scripts that save data using datastore but they appear on leaderboard which i dont want. i cant fix it either because i used a plugin to add scripts and i dont even understand anything about it

anyways here are the scripts

datastore:

local datastore = game:GetService("DataStoreService"):GetDataStore("leaderstats")

game.Players.PlayerAdded:Connect(function(plr)

	wait()

	local plrkey = "id_"..plr.userId

	local savevalue = plr.leaderstats.Cash

	local GetSaved = datastore:GetAsync(plrkey)

	if GetSaved then

		savevalue.Value = GetSaved[1]

	else

		local NumbersForSaving = {savevalue.Value}

		datastore:GetAsync(plrkey, NumbersForSaving)

	end

end)

game.Players.PlayerRemoving:Connect(function(plr)

	datastore:SetAsync("id_"..plr.userId, {plr.leaderstats.Cash.Value})

end)

leaderstats:

game.Players.PlayerAdded:Connect(function(plr)

	local leaderstats = Instance.new("Folder", plr)
	leaderstats.Name = "leaderstats"

	local Cash = Instance.new("IntValue", leaderstats) - variable
	Cash.Name = "Cash" -- Name
	Cash.Value = 100 -- Initial Value
	
	if true then
		
	end
end)

how to remove it from leaderboard

To not have it show in the leaderboard, you just have to store it in some place other than PLAYER.leaderstats. If you want to store it in the player still, just create a new folder, or change “leaderstats” to anything else (e.g. “data”)

do folders have to be called leaderstats to store their data?

Folders called leaderstats parented to the player object behave like normal folders, except they are unique in that anything contained within it is displayed on the leaderboard at the top right of the screen,

Folders, regardless of their name, are able to store any object (or data as you call it in this case)!

1 Like

i didn`t really need that much on folders i only asked for leaderstats but anyways Thanks!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.