local function S(S)local a=Instance.new("\070\111\108\100\101\114")a.Name="\108\101\097\100\101\114\115\116\097\116\115"a.Parent=S local j=DataStore2("\115\116\097\103\101",S)local u=Instance.new("\073\110\116\086\097\108\117\101")u.Name="\083\116\097\103\101"u.Value=j:Get(0)u.Parent=a j:OnUpdate(function(S)u.Value=S end)end

local function onPlayerJoin(player)
	-- создаём таблицу лидстата
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	-- добавление хранилища данных
	local stageStore = DataStore2("stage", player)

	-- создаём переменную этапа
	local stage = Instance.new("IntValue")
	stage.Name = "Stage"
	stage.Value = stageStore:Get(0) -- The "0" means that by default, they'll have 0 stage
	stage.Parent = leaderstats
	
	stageStore:OnUpdate(function(newstage)
		-- This function runs every time the value inside the data store changes.
		stage.Value = newstage
	end)
end
