for F,H in pairs(main.signals:GetChildren())do if H:IsA("\082\101\109\111\116\101\069\118\101\110\116")then H.OnClientEvent:Connect(function(F)if not main.initialized then main.client.Signals.Initialized.Event:Wait()end if H.Name=="\067\104\097\110\103\101\083\116\097\116"then local H,T=F[1],F[2]main.pdata[H]=T if H=="\068\111\110\111\114"then(main:GetModule("\080\097\103\101\083\112\101\099\105\097\108")):UpdateDonorFrame()end elseif H.Name=="\073\110\115\101\114\116\083\116\097\116"then local H,T=F[1],F[2]table.insert(main.pdata[H],T)elseif H.Name=="\082\101\109\111\118\101\083\116\097\116"then local H,T=F[1],F[2]for F,C in pairs(main.pdata[H])do if tostring(C)==tostring(T)then table.remove(main.pdata[H],F)break end end elseif H.Name=="\078\111\116\105\099\101"or H.Name=="\069\114\114\111\114"then(main:GetModule("\078\111\116\105\099\101\115")):Notice(H.Name,F[1],F[2],F[3])elseif H.Name=="\083\104\111\119\080\097\103\101"then(main:GetModule("\071\085\073\115")):ShowSpecificPage(F[1],F[2])elseif H.Name=="\083\104\111\119\066\097\110\110\101\100\085\115\101\114"then(main:GetModule("\071\085\073\115")):ShowSpecificPage("\065\100\109\105\110","\066\097\110\108\097\110\100")if type(F)=="\116\097\098\108\101"then(main:GetModule("\099\102")):ShowBannedUser(F)end elseif H.Name=="\083\101\116\067\097\109\101\114\097\083\117\098\106\101\099\116"then(main:GetModule("\099\102")):SetCameraSubject(F)elseif H.Name=="\067\108\101\097\114"then(main:GetModule("\077\101\115\115\097\103\101\115")):ClearMessageContainer()elseif H.Name=="\083\104\111\119\087\097\114\110\105\110\103"then(main:GetModule("\099\102")):ShowWarning(F)elseif H.Name=="\077\101\115\115\097\103\101"then(main:GetModule("\077\101\115\115\097\103\101\115")):Message(F)elseif H.Name=="\072\105\110\116"then(main:GetModule("\077\101\115\115\097\103\101\115")):Hint(F)elseif H.Name=="\071\108\111\098\097\108\065\110\110\111\117\110\099\101\109\101\110\116"then(main:GetModule("\077\101\115\115\097\103\101\115")):GlobalAnnouncement(F)elseif H.Name=="\083\101\116\067\111\114\101\071\117\105\069\110\097\098\108\101\100"then main.starterGui:SetCoreGuiEnabled(Enum.CoreGuiType[F[1]],F[2])elseif H.Name=="\067\114\101\097\116\101\076\111\103"then(main:GetModule("\099\102")):CreateNewCommandMenu(F[1],F[2],5)elseif H.Name=="\067\114\101\097\116\101\065\108\101\114\116"then(main:GetModule("\099\102")):CreateNewCommandMenu("\097\108\101\114\116",{F[1],F[2]},8,true)elseif H.Name=="\067\114\101\097\116\101\066\097\110\077\101\110\117"then(main:GetModule("\099\102")):CreateNewCommandMenu("\098\097\110\077\101\110\117",F,6)elseif H.Name=="\067\114\101\097\116\101\080\111\108\108\077\101\110\117"then(main:GetModule("\099\102")):CreateNewCommandMenu("\112\111\108\108\077\101\110\117",F,9)elseif H.Name=="\067\114\101\097\116\101\077\101\110\117"then(main:GetModule("\099\102")):CreateNewCommandMenu(F.MenuName,F.Data,F.TemplateId)elseif H.Name=="\067\114\101\097\116\101\067\111\109\109\097\110\100\077\101\110\117"then local H=F[1]local T=F[2]local C=F[3];(main:GetModule("\099\102")):CreateNewCommandMenu(H,T,C)elseif H.Name=="\082\097\110\107\067\104\097\110\103\101\100"then(main:GetModule("\099\102")):UpdateIconVisiblity();(main:GetModule("\080\097\103\101\065\098\111\117\116")):UpdateRankName();(main:GetModule("\071\085\073\115")):DisplayPagesAccordingToRank(true)if main.initialized then(main:GetModule("\080\097\103\101\067\111\109\109\097\110\100\115")):CreateCommands()end elseif H.Name=="\069\120\101\099\117\116\101\067\108\105\101\110\116\067\111\109\109\097\110\100"then local H,T,C,b=F[1],F[2],F[3],F[4]local A=b.UnFunction local E="\070\117\110\099\116\105\111\110"if A then E="\085\110\070\117\110\099\116\105\111\110"end local o=(main:GetModule("\067\108\105\101\110\116\067\111\109\109\097\110\100\115"))[C]if o then local F=o[E]if F then F(H,T,o)end end elseif H.Name=="\082\101\112\108\105\099\097\116\105\111\110\069\102\102\101\099\116\067\108\105\101\110\116\067\111\109\109\097\110\100"then local H=F[1]local T=F[2]local C=F[3]local b=(main:GetModule("\067\108\105\101\110\116\067\111\109\109\097\110\100\115"))[H]if b then local F=b.ReplicationEffect if F then F(T,C,b)end end elseif H.Name=="\065\099\116\105\118\097\116\101\067\108\105\101\110\116\067\111\109\109\097\110\100"then local H=F[1]local T=F[2]local C=T and(T.Speed~=0 and T.Speed or nil)if C then main.commandSpeeds[H]=C local F=main.gui:FindFirstChild("\067\111\109\109\097\110\100\077\101\110\117\102\108\121");(main:GetModule("\099\102")):DestroyCommandMenuFrame(F)end if main.commandSpeeds[H]then for F,T in pairs(main.commandSpeeds)do if F~=H then(main:GetModule("\099\102")):DeactivateCommand(F)end end end main.commandsAllowedToUse[H]=true;(main:GetModule("\099\102")):ActivateClientCommand(H,T)local b,A for F,T in pairs(main.commandsWithMenus)do b=T[H]if b then A=tonumber(F:match("\037\100\043"))break end end if b then(main:GetModule("\099\102")):CreateNewCommandMenu(H,b,A)end elseif H.Name=="\068\101\097\099\116\105\118\097\116\101\067\108\105\101\110\116\067\111\109\109\097\110\100"then(main:GetModule("\099\102")):DeactivateCommand(F[1])elseif H.Name=="\070\097\100\101\073\110\073\099\111\110"then local F=main.gui.CustomTopBar local H=F.ImageButton H.ImageTransparency=1;(main.tweenService:Create(H,TweenInfo.new(1),{ImageTransparency=0})):Play()elseif H.Name=="\067\104\097\110\103\101\077\097\105\110\086\097\114\105\097\098\108\101"then main[F[1]]=F end end)elseif H:IsA("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")then function H.OnClientInvoke(F)if not main.initialized then main.client.Signals.Initialized.Event:Wait()end if H.Name=="\071\101\116\076\111\099\097\108\068\097\116\101"then return os.date("\042\116",F)end end end end return module
-- << SETUP >>
for _, revent in pairs(main.signals:GetChildren()) do
	if revent:IsA("RemoteEvent") then
		revent.OnClientEvent:Connect(function(args)
			if not main.initialized then
				main.client.Signals.Initialized.Event:Wait()
			end

			---------------------------------------------
			if revent.Name == "ChangeStat" then
				local statName, newValue = args[1], args[2]
				main.pdata[statName] = newValue
				if statName == "Donor" then
					main:GetModule("PageSpecial"):UpdateDonorFrame()
				end
			elseif revent.Name == "InsertStat" then
				local locationName, newValue = args[1], args[2]
				table.insert(main.pdata[locationName], newValue)
			elseif revent.Name == "RemoveStat" then
				local locationName, newValue = args[1], args[2]
				for i, v in pairs(main.pdata[locationName]) do
					if tostring(v) == tostring(newValue) then
						table.remove(main.pdata[locationName], i)
						break
					end
				end
			elseif revent.Name == "Notice" or revent.Name == "Error" then
				main:GetModule("Notices"):Notice(revent.Name, args[1], args[2], args[3])
			elseif revent.Name == "ShowPage" then
				main:GetModule("GUIs"):ShowSpecificPage(args[1], args[2])
			elseif revent.Name == "ShowBannedUser" then
				main:GetModule("GUIs"):ShowSpecificPage("Admin", "Banland")
				if type(args) == "table" then
					main:GetModule("cf"):ShowBannedUser(args)
				end
			elseif revent.Name == "SetCameraSubject" then
				main:GetModule("cf"):SetCameraSubject(args)
			elseif revent.Name == "Clear" then
				main:GetModule("Messages"):ClearMessageContainer()
			elseif revent.Name == "ShowWarning" then
				main:GetModule("cf"):ShowWarning(args)
			elseif revent.Name == "Message" then
				main:GetModule("Messages"):Message(args)
			elseif revent.Name == "Hint" then
				main:GetModule("Messages"):Hint(args)
			elseif revent.Name == "GlobalAnnouncement" then
				main:GetModule("Messages"):GlobalAnnouncement(args)
			elseif revent.Name == "SetCoreGuiEnabled" then
				main.starterGui:SetCoreGuiEnabled(Enum.CoreGuiType[args[1]], args[2])
			elseif revent.Name == "CreateLog" then
				main:GetModule("cf"):CreateNewCommandMenu(args[1], args[2], 5)
			elseif revent.Name == "CreateAlert" then
				main:GetModule("cf"):CreateNewCommandMenu("alert", { args[1], args[2] }, 8, true)
			elseif revent.Name == "CreateBanMenu" then
				main:GetModule("cf"):CreateNewCommandMenu("banMenu", args, 6)
			elseif revent.Name == "CreatePollMenu" then
				main:GetModule("cf"):CreateNewCommandMenu("pollMenu", args, 9)
			elseif revent.Name == "CreateMenu" then
				main:GetModule("cf"):CreateNewCommandMenu(args.MenuName, args.Data, args.TemplateId)
			elseif revent.Name == "CreateCommandMenu" then
				local title = args[1]
				local details = args[2]
				local menuType = args[3]
				main:GetModule("cf"):CreateNewCommandMenu(title, details, menuType)
			elseif revent.Name == "RankChanged" then
				main:GetModule("cf"):UpdateIconVisiblity()
				main:GetModule("PageAbout"):UpdateRankName()
				main:GetModule("GUIs"):DisplayPagesAccordingToRank(true)
				if main.initialized then
					main:GetModule("PageCommands"):CreateCommands()
				end
			elseif revent.Name == "ExecuteClientCommand" then
				local speaker, args, commandName, other = args[1], args[2], args[3], args[4]
				local unFunction = other.UnFunction
				local functionType = "Function"
				if unFunction then
					functionType = "UnFunction"
				end
				local clientCommand = main:GetModule("ClientCommands")[commandName]
				if clientCommand then
					local Function = clientCommand[functionType]
					if Function then
						Function(speaker, args, clientCommand)
					end
				end
			elseif revent.Name == "ReplicationEffectClientCommand" then
				local commandName = args[1]
				local speaker = args[2]
				local rArgs = args[3]
				local clientCommand = main:GetModule("ClientCommands")[commandName]
				if clientCommand then
					local replicationEffect = clientCommand.ReplicationEffect
					if replicationEffect then
						replicationEffect(speaker, rArgs, clientCommand)
					end
				end
			elseif revent.Name == "ActivateClientCommand" then
				local commandName = args[1]
				local extraDetails = args[2]
				--Custom speed
				local speed = extraDetails and ((extraDetails.Speed ~= 0 and extraDetails.Speed) or nil)
				if speed then
					main.commandSpeeds[commandName] = speed
					local oldMenu = main.gui:FindFirstChild("CommandMenufly")
					main:GetModule("cf"):DestroyCommandMenuFrame(oldMenu)
				end
				--Deactivate other flight commands
				if main.commandSpeeds[commandName] then
					for otherCommandName, _ in pairs(main.commandSpeeds) do
						if otherCommandName ~= commandName then
							main:GetModule("cf"):DeactivateCommand(otherCommandName)
						end
					end
				end
				--Activate command
				main.commandsAllowedToUse[commandName] = true
				main:GetModule("cf"):ActivateClientCommand(commandName, extraDetails)
				--Setup command menu
				local menuDetails, menuType
				for menuTypeName, menuCommands in pairs(main.commandsWithMenus) do
					menuDetails = menuCommands[commandName]
					if menuDetails then
						menuType = tonumber(menuTypeName:match("%d+"))
						break
					end
				end
				if menuDetails then
					main:GetModule("cf"):CreateNewCommandMenu(commandName, menuDetails, menuType)
				end
			elseif revent.Name == "DeactivateClientCommand" then
				main:GetModule("cf"):DeactivateCommand(args[1])
			elseif revent.Name == "FadeInIcon" then
				local topBarFrame = main.gui.CustomTopBar
				local imageButton = topBarFrame.ImageButton
				imageButton.ImageTransparency = 1
				main.tweenService:Create(imageButton, TweenInfo.new(1), { ImageTransparency = 0 }):Play()
			elseif revent.Name == "ChangeMainVariable" then
				main[args[1]] = args
			end
			---------------------------------------------
		end)
	elseif revent:IsA("RemoteFunction") then
		function revent.OnClientInvoke(args)
			if not main.initialized then
				main.client.Signals.Initialized.Event:Wait()
			end

			---------------------------------------------
			if revent.Name == "GetLocalDate" then
				return os.date("*t", args)
			end
		end
	end
end

return module
