Is it even possible to get every player who every played a game with an variable

So yeah, currently im asking very often about saving and this stuff and heres on more question,
is it even possible to get every player who ever played the game to an variable or who has a special value:

local Plr = [GetAllPlayer(please correct this)]

if Plr.leaderstats:FindFirstChild("Played") then
--my action not important
end

ik my question is pretty odd, but it will help me, thank you!

(Offline Accounts included, thank you)

I think you can create a table then use
game.Players.PlayerAdded:Connect()
to insert the players userid upon joining and save that table to a datastore?
not 100% sure if this works cuz im also new

i think you forgot that.-.-.-. (Read reply)

it grabs the userid of every player that has joined so even if they leave the userid would still save to the table? Im not sure if I understand tbh

i want smth like this (its wrong ik):

--Normal script in serverscript service

game.Players.PlayerAdded:Connect(function (plr)
local DataStoreService = game:GetService("DataStoreService"):GetDataStore("PlrSave")

DataStoreService:SetAsynch("Key",plr.UserId)
end)

correct this if wrong (on reply)

That breaks the script and will only save for last player, you even spelt SetAsync incorrectly
You can try this method (note: might not save if multiple servers try to access the data at the same time, consider using DataStore2 or ProfileService if this bothers you):

local data = game:GetService("DataStoreService"):GetDataStore("PlrSave")

game.Players.PlayerAdded:Connect(function(plr)
	local plrTable
	local s, e = pcall(function()
		plrTable = data:GetAsync("Key") -- get table
	end)
	if not s then warn("retrieving data failed, reason: "..e) return end -- error
	table.insert(plrTable, plr.UserId) -- insert userId
	
	local s1, e1 = pcall(function()
		data:SetAsync("Key", plrTable) -- set table
	end)
	if not s1 then warn("setting data failed, reason: "..e1) return end -- error
end)

Alr thank you very much, ill try it, if it works i accept it as solution