local function G(G,z)for G,q in pairs(G:GetDescendants())do if q:IsA("\071\117\105\079\098\106\101\099\116")and q:FindFirstChild("\079\114\105\103\105\110\097\108\090\073\110\100\101\120")==nil then local G=Instance.new("\073\110\116\086\097\108\117\101")G.Name="\079\114\105\103\105\110\097\108\090\073\110\100\101\120"local u=q.ZIndex if z then u=u+10000 end G.Value=u G.Parent=q end end end local function z(G,z)for G,q in pairs(main.commandMenus)do for u,t in pairs(q:GetDescendants())do if t:IsA("\071\117\105\079\098\106\101\099\116")then if t:FindFirstChild("\079\114\105\103\105\110\097\108\090\073\110\100\101\120")and(not z or q==z)then t.ZIndex=(t.OriginalZIndex.Value+(G-1)*10)-1000 end end end end end
-- << LOCAL FUNCTIONS >>
local function setupOriginalZIndex(frame, forceOnTop)
	for a, b in pairs(frame:GetDescendants()) do
		if b:IsA("GuiObject") and b:FindFirstChild("OriginalZIndex") == nil then
			local iValue = Instance.new("IntValue")
			iValue.Name = "OriginalZIndex"
			local zValue = b.ZIndex
			if forceOnTop then
				zValue = zValue + 10000
			end
			iValue.Value = zValue
			iValue.Parent = b
		end
	end
end
local function updateZIndex(list, specificFrame)
	for i, v in pairs(main.commandMenus) do
		for a, b in pairs(v:GetDescendants()) do
			if b:IsA("GuiObject") then
				if b:FindFirstChild("OriginalZIndex") and (not specificFrame or v == specificFrame) then
					b.ZIndex = b.OriginalZIndex.Value + ((i - 1) * 10) - 1000
				end
			end
		end
	end
end
