I can't seem to get my script to work I don't want these values to show in leaderstats so I tried to save it from a different folder in the same location as leaderstats

local DSService = game:GetService("DataStoreService"):GetDataStore("Q14ER056")
game.Players.PlayerAdded:Connect(function(plr)
	local key = plr.Name
	local cmdsets = Instance.new("Folder", plr)
	local savevalue = Instance.new("BoolValue")
	cmdsets.Name = "Rankings"
	savevalue.Parent = cmdsets
	savevalue.Name = "IsAdmin"
	local getsaved = DSService:GetAsync(key)
	if getsaved then
		savevalue.Value = getsaved[1]
	else
		local NumbersToSave = {savevalue.Value}
		DSService:SetAsync(key, NumbersToSave)
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	local key = plr.Name
	local ST = {plr.cmdsets.IsAdmin.Value}
	DSService:SetAsync(key, ST)
end)

3 comments

1

same thing

0

Datastores are not linked to the game in any way unlike older system that needed a player object. You are free to add /edit and remove keys at will (within the limitations of datastores) .

0

There is no limitations to datastores but there is limitations of how much can be inside of one datastore.