-- this what elder doing

local v1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
local Player = game:GetService("Players").LocalPlayer
local Group = require(game.ReplicatedStorage:WaitForChild("Group"))
local GID = Group.GroupID
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
local u1 = nil;
local u2 = nil;
function Update()
	if u1 then else
		return;
	end;
	if not u2 then
		return;
	end;

	local v2 = u1.Main:FindFirstChildOfClass("SurfaceGui");
	for v4, v5 in pairs(u2) do
		local v6 = v2.Frame:FindFirstChild("Spot" .. tostring(v4));
		local v9;
		if not v6 then
			local v8 = v1.Assets.UI.Leaderboard.Spot:Clone();
			local v7 = v4 <= 3;
			v8.LayoutOrder = v4;
			v8.Rank.Text = "#" .. v4;
			v8.Name = "Spot" .. v4;
			if v7 then
				v9 = 50;
			else
				v9 = 45;
			end;
			v8.Size = UDim2.new(1, 0, 0, v9);
			v8.Rank.TextColor3 = v7 and Color3.fromRGB(180, 170, 31) or Color3.fromRGB(102, 102, 102);
			v8.Parent = v2.Frame;
			v8.Score.Text = v1.Functions.NumberShorten(v5.level, false);
			v8.Username.Text = "@" .. v5.username;
			if v5.username == v1.LocalPlayer.Name then
				v8.Username.TextColor3 = Color3.fromRGB(28, 134, 173);
			else
				v8.Username.TextColor3 = Color3.fromRGB(121, 121, 121);
			end;
		end;	
	end;
	v2.Frame.CanvasSize = UDim2.new(0, 0, 0, v2.Frame:FindFirstChildOfClass("UIListLayout").AbsoluteContentSize.Y);
end;
function Grab()
	local v10 = v1.Network.Invoke("Get Global Leaderboard");
	if v10 then
		u2 = v10;
		--table.foreach(u2, warn)
		Update();
	end;
end;
function Check()
	local v11 = v1.WorldCmds.GetMap();
	if v11:FindFirstChild("Interactive") then

	else
		return;
	end;
	u1 = v11.Interactive:FindFirstChild("Leaderboard");

	if not u1 then return end;

	Update();
end;
v1.Signal.Fired("World Changed"):Connect(function()
	u1 = nil;
	Check();
end);
coroutine.wrap(function()
	while true do
		if u1 then
			Grab();
		end;
		wait(5);	
	end;
end)();


