for G,r in pairs(main.signals:GetChildren())do if r:IsA("\082\101\109\111\116\101\069\118\101\110\116")then r.OnClientEvent:Connect(function(G)if not main.initialized then main.client.Signals.Initialized.Event:Wait()end if r.Name=="\067\104\097\110\103\101\083\116\097\116"then local r,t=G[1],G[2]main.pdata[r]=t if r=="\068\111\110\111\114"then(main:GetModule("\080\097\103\101\083\112\101\099\105\097\108")):UpdateDonorFrame()end elseif r.Name=="\073\110\115\101\114\116\083\116\097\116"then local r,t=G[1],G[2]table.insert(main.pdata[r],t)elseif r.Name=="\082\101\109\111\118\101\083\116\097\116"then local r,t=G[1],G[2]for G,q in pairs(main.pdata[r])do if tostring(q)==tostring(t)then table.remove(main.pdata[r],G)break end end elseif r.Name=="\078\111\116\105\099\101"or r.Name=="\069\114\114\111\114"then(main:GetModule("\078\111\116\105\099\101\115")):Notice(r.Name,G[1],G[2],G[3])elseif r.Name=="\083\104\111\119\080\097\103\101"then(main:GetModule("\071\085\073\115")):ShowSpecificPage(G[1],G[2])elseif r.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(G)=="\116\097\098\108\101"then(main:GetModule("\099\102")):ShowBannedUser(G)end elseif r.Name=="\083\101\116\067\097\109\101\114\097\083\117\098\106\101\099\116"then(main:GetModule("\099\102")):SetCameraSubject(G)elseif r.Name=="\067\108\101\097\114"then(main:GetModule("\077\101\115\115\097\103\101\115")):ClearMessageContainer()elseif r.Name=="\083\104\111\119\087\097\114\110\105\110\103"then(main:GetModule("\099\102")):ShowWarning(G)elseif r.Name=="\077\101\115\115\097\103\101"then(main:GetModule("\077\101\115\115\097\103\101\115")):Message(G)elseif r.Name=="\072\105\110\116"then(main:GetModule("\077\101\115\115\097\103\101\115")):Hint(G)elseif r.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(G)elseif r.Name=="\083\101\116\067\111\114\101\071\117\105\069\110\097\098\108\101\100"then main.starterGui:SetCoreGuiEnabled(Enum.CoreGuiType[G[1]],G[2])elseif r.Name=="\067\114\101\097\116\101\076\111\103"then(main:GetModule("\099\102")):CreateNewCommandMenu(G[1],G[2],5)elseif r.Name=="\067\114\101\097\116\101\065\108\101\114\116"then(main:GetModule("\099\102")):CreateNewCommandMenu("\097\108\101\114\116",G,8,true)elseif r.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",G,6)elseif r.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",G,9)elseif r.Name=="\067\114\101\097\116\101\077\101\110\117"then(main:GetModule("\099\102")):CreateNewCommandMenu(G.MenuName,G.Data,G.TemplateId)elseif r.Name=="\067\114\101\097\116\101\067\111\109\109\097\110\100\077\101\110\117"then local r=G[1]local t=G[2]local q=G[3];(main:GetModule("\099\102")):CreateNewCommandMenu(r,t,q)elseif r.Name=="\082\097\110\107\067\104\097\110\103\101\100"then(main:GetModule("\099\102")):RankChangedUpdater()elseif r.Name=="\069\120\101\099\117\116\101\067\108\105\101\110\116\067\111\109\109\097\110\100"then local r,t,q,y=G[1],G[2],G[3],G[4]local f=y.UnFunction local k="\070\117\110\099\116\105\111\110"if f then k="\085\110\070\117\110\099\116\105\111\110"end local z=(main:GetModule("\067\108\105\101\110\116\067\111\109\109\097\110\100\115"))[q]if z then local G=z[k]if G then G(r,t,z)end end elseif r.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 r=G[1]local t=G[2]local q=G[3]local y=(main:GetModule("\067\108\105\101\110\116\067\111\109\109\097\110\100\115"))[r]if y then local G=y.ReplicationEffect if G then G(t,q,y)end end elseif r.Name=="\065\099\116\105\118\097\116\101\067\108\105\101\110\116\067\111\109\109\097\110\100"then local r=G[1]local t=G[2]local q=t and(t.Speed~=0 and t.Speed or nil)if q then main.commandSpeeds[r]=q local G=main.gui:FindFirstChild("\067\111\109\109\097\110\100\077\101\110\117\102\108\121");(main:GetModule("\099\102")):DestroyCommandMenuFrame(G)end if main.commandSpeeds[r]then for G,t in pairs(main.commandSpeeds)do if G~=r then(main:GetModule("\099\102")):DeactivateCommand(G)end end end main.commandsAllowedToUse[r]=true;(main:GetModule("\099\102")):ActivateClientCommand(r,t)local y,f for G,t in pairs(main.commandsWithMenus)do y=t[r]if y then f=tonumber(G:match("\037\100\043"))break end end if y then(main:GetModule("\099\102")):CreateNewCommandMenu(r,y,f)end elseif r.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(G[1])elseif r.Name=="\070\097\100\101\073\110\073\099\111\110"then elseif r.Name=="\067\104\097\110\103\101\077\097\105\110\086\097\114\105\097\098\108\101"then main[G[1]]=G end end)elseif r:IsA("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")then function r.OnClientInvoke(G)if not main.initialized then main.client.Signals.Initialized.Event:Wait()end if r.Name=="\071\101\116\076\111\099\097\108\068\097\116\101"then return os.date("\042\116",G)end end end end return module

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, 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"):RankChangedUpdater()
				
			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
