local function L(L,A)if A then L.LoadingButton.Visible=true L.MainButton.Visible=false else L.LoadingButton.Visible=false L.MainButton.Visible=true end end for A,g in pairs(main.warnings:GetChildren())do g.CloseX.MouseButton1Down:Connect(function()main.warnings.Visible=false end)local E=g:FindFirstChild("\077\097\105\110\066\117\116\116\111\110")if E then local A=true E.MouseButton1Down:Connect(function()if A then A=false if g.Name=="\066\117\121\070\114\097\109\101"then local L=E.ProductId.Value local A=E.ProductType.Value if A=="\071\097\109\101\112\097\115\115"then main.marketplaceService:PromptGamePassPurchase(main.player,L)else main.marketplaceService:PromptPurchase(main.player,L)end elseif g.Name=="\085\110\066\097\110"then L(g,true)main.signals.RequestCommand:InvokeServer(main.pdata.Prefix..("\117\110\100\105\114\101\099\116\098\097\110 "..g.PlrName.Text));(main:GetModule("\080\097\103\101\065\100\109\105\110")):CreateBanland()L(g,false)main.warnings.Visible=false elseif g.Name=="\080\101\114\109\082\097\110\107"then L(g,true)local A=g.PlrName.Text local E=(main:GetModule("\099\102")):GetUserId(A)main.signals.RemovePermRank:InvokeServer({E,A});(main:GetModule("\080\097\103\101\065\100\109\105\110")):CreateRanks()L(g,false)main.warnings.Visible=false elseif g.Name=="\084\101\108\101\112\111\114\116"then L(g,true)local A=g.MainButton.PlaceId.Value main.teleportService:Teleport(A)main.teleportService.TeleportInitFailed:Wait()L(g,false)end A=true end end)end end main.warnings.Visible=false
-- << WARNINGS >>
--CloseX
local function showLoading(warningFrame, status)
	if status then
		warningFrame.LoadingButton.Visible = true
		warningFrame.MainButton.Visible = false
	else
		warningFrame.LoadingButton.Visible = false
		warningFrame.MainButton.Visible = true
	end
end
for _, warningFrame in pairs(main.warnings:GetChildren()) do
	warningFrame.CloseX.MouseButton1Down:Connect(function()
		main.warnings.Visible = false
	end)
	local button = warningFrame:FindFirstChild("MainButton")
	if button then
		local buttonDe = true
		button.MouseButton1Down:Connect(function()
			if buttonDe then
				buttonDe = false
				if warningFrame.Name == "BuyFrame" then
					local productId = button.ProductId.Value
					local productType = button.ProductType.Value
					if productType == "Gamepass" then
						main.marketplaceService:PromptGamePassPurchase(main.player, productId)
					else
						main.marketplaceService:PromptPurchase(main.player, productId)
					end
				elseif warningFrame.Name == "UnBan" then
					showLoading(warningFrame, true)
					main.signals.RequestCommand:InvokeServer(
						main.pdata.Prefix .. "undirectban " .. warningFrame.PlrName.Text
					)
					main:GetModule("PageAdmin"):CreateBanland()
					showLoading(warningFrame, false)
					main.warnings.Visible = false
				elseif warningFrame.Name == "PermRank" then
					showLoading(warningFrame, true)
					local userName = warningFrame.PlrName.Text
					local id = main:GetModule("cf"):GetUserId(userName)
					main.signals.RemovePermRank:InvokeServer({ id, userName })
					main:GetModule("PageAdmin"):CreateRanks()
					showLoading(warningFrame, false)
					main.warnings.Visible = false
				elseif warningFrame.Name == "Teleport" then
					showLoading(warningFrame, true)
					local placeId = warningFrame.MainButton.PlaceId.Value
					main.teleportService:Teleport(placeId)
					main.teleportService.TeleportInitFailed:Wait()
					showLoading(warningFrame, false)
				end
				buttonDe = true
			end
		end)
	end
end
main.warnings.Visible = false
