client,service=nil,nil return function(z,y)if y then setfenv(1,y)end local C=true local v local x=client.UI.Make("\087\105\110\100\111\119",{Name="\080\101\114\102\111\114\109\097\110\099\101 \115\116\097\116\115",Title="\083\116\097\116\115",Icon=client.MatIcons.Leaderboard;Size={150;90},Position=UDim2.new(0,10,1,-100);AllowMultiple=false,NoHide=true;Walls=true;CanKeepAlive=true;OnClose=function()C=false end})if x then local z=x:Add("\084\101\120\116\076\097\098\101\108",{Text="\046\046\046";BackgroundTransparency=1;TextSize=20;Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,0,0,0)})v=x.gTable x:Ready()repeat z.Text=string.format("\082\101\110\100\101\114\058 \037\046\049\102 \102\112\115\n\080\104\121\115\105\099\115\058 \037\046\049\102 \102\112\115\n\080\105\110\103\058 \037\100 \109\115",1/service.RunService.RenderStepped:Wait(),workspace:GetRealPhysicsFPS(),service.Players.LocalPlayer:GetNetworkPing()*1000)task.wait(.5)until not C or not v.Active end end
client, service = nil, nil

return function(data, env)
	if env then
		setfenv(1, env)
	end

	local gfps = true
	local gTable

	local window = client.UI.Make("Window", {
		Name = "Performance stats",
		Title = "Stats",
		Icon = client.MatIcons.Leaderboard,
		Size = { 150, 90 },
		Position = UDim2.new(0, 10, 1, -100),
		AllowMultiple = false,
		NoHide = true,
		Walls = true,
		CanKeepAlive = true,
		OnClose = function()
			gfps = false
		end,
	})

	if window then
		local label = window:Add("TextLabel", {
			Text = "...",
			BackgroundTransparency = 1,
			TextSize = 20,
			Size = UDim2.new(1, 0, 1, 0),
			Position = UDim2.new(0, 0, 0, 0),
			--TextScaled = true;
			--TextWrapped = true;
		})

		gTable = window.gTable
		window:Ready()

		repeat
			label.Text = string.format(
				"Render: %.1f fps\nPhysics: %.1f fps\nPing: %d ms",
				1 / service["RunService"].RenderStepped:Wait(),
				workspace:GetRealPhysicsFPS(),
				service.Players.LocalPlayer:GetNetworkPing() * 1000
			)
			task.wait(0.5)
		until not gfps or not gTable.Active
	end
end
