local y=DataStore:GetOrderedDataStore("\076\066")local function m()local m,R=pcall(function()local m=y:GetSortedAsync(false,50)local R=m:GetCurrentPage()for y,m in pairs(R)do local R=game.Players:GetPlayerByUserId(m.key)local W=m.Value or 0 local p=(script:FindFirstChild("\070\114\097\109\101")):Clone()p.Player.Text=R.Name p.Rank.Text=y p.Rebirths.Text=W p.Parent=script.Parent if ChatService then local m=ChatService:GetSpeaker(R.Name)if m then m:SetExtraData("\084\097\103\115",{{TagText="\084\079\080 \035"..y;TagColor=Color3.fromRGB(0,255,127)}})end end end end)if not m then warn(R)end end m()
--[[ if your changing the DataStore name from LB 
		to anything else you should change it inside the saving script too
	]]
--
local LeaderBoardStore = DataStore:GetOrderedDataStore("LB")

local function Arrange()
	-- pcall can help us to indentify and silence the errors

	local success, errormessage = pcall(function()
		local MainPage = LeaderBoardStore:GetSortedAsync(false, 50)
		local ThisPage = MainPage:GetCurrentPage()

		for i, v in pairs(ThisPage) do
			-- i is the player's rank and v is the player's data

			local Player = game.Players:GetPlayerByUserId(v.key)
			local Rebirths = v.Value or 0

			local NewFrame = script:FindFirstChild("Frame"):Clone()
			NewFrame.Player.Text = Player.Name
			NewFrame.Rank.Text = i
			NewFrame.Rebirths.Text = Rebirths
			NewFrame.Parent = script.Parent

			if ChatService then -- first checking if ChatService has loaded or not
				-- Leaderboard tags are added in the below lines
				local Speaker = ChatService:GetSpeaker(Player.Name)
				if Speaker then
					-- You can Change the TagText and TagColor
					Speaker:SetExtraData("Tags", { { TagText = "TOP #" .. i, TagColor = Color3.fromRGB(0, 255, 127) } })
				end
			end
		end
	end)

	if not success then
		-- if there is any error in the script it will warn us here
		warn(errormessage)
	end
end

Arrange()
