for z,p in pairs(main.signals:GetChildren())do if p:IsA("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")then local z=p function z.OnServerInvoke(u,P,...)local U=main.pd[u]if U then checkRemoteLimit(u,p)if z.Name=="\082\101\116\114\105\101\118\101\068\097\116\097"then if not main.initialized then main.signals.Initialized.Event:Wait()end if not U or not U.SetupData then repeat wait(.1)U=main.pd[u]until U and U.SetupData or not u end local z={pdata=U,permissions=main.permissions;commandInfo=main.commandInfo,commandRanks=main.commandRanks;infoOnAllCommands=main.infoOnAllCommands,settings={Ranks=main.settings.Ranks;UniversalPrefix=main.settings.UniversalPrefix;Colors=main.settings.Colors;ThemeColors=main.settings.ThemeColors,Cmdbar=main.settings.Cmdbar,Cmdbar2=main.settings.Cmdbar2,ViewBanland=main.settings.ViewBanland,DisableAllNotices=main.settings.DisableAllNotices,RankRequiredToViewPage=main.settings.RankRequiredToViewPage,OnlyShowUsableCommands=main.settings.OnlyShowUsableCommands,CommandLimits=main.settings.CommandLimits;RankRequiredToViewIcon=main.settings.RankRequiredToViewIcon};morphNames=main.morphNames,toolNames=main.toolNames;ownerName=main.ownerName;ownerId=main.ownerId,gameName=main.gameName,hdAdminGroup=main.hdAdminGroup}return z elseif z.Name=="\082\101\113\117\101\115\116\067\111\109\109\097\110\100"then local z=(main:GetModule("\080\097\114\115\101\114")):ParseMessage(u,P,false,...)return z elseif z.Name=="\067\104\097\110\103\101\083\101\116\116\105\110\103"then local z=P[1]local p=main.settings[z]local U=P[2]if(main:GetModule("\099\102")):FindValue(main.validSettings,z)then if z=="\080\114\101\102\105\120"then if#U~=1 then return"\080\114\101\102\105\120 \099\097\110 \111\110\108\121 \098\101 \049 \099\104\097\114\097\099\116\101\114\033"elseif U==main.settings.UniversalPrefix then return"\067\097\110\110\111\116 \115\101\116 \116\111 \116\104\101 \085\110\105\118\101\114\115\097\108\080\114\101\102\105\120\033"end elseif string.sub(z,-7)=="\083\111\117\110\100\073\100"and not(main:GetModule("\099\102")):CheckIfValidSound(U)then return"\073\110\118\097\108\105\100 \115\111\117\110\100\033"elseif tonumber(p)and not tonumber(U)then return"\073\110\118\097\108\105\100 \110\117\109\098\101\114\033"end;(main:GetModule("\080\108\097\121\101\114\068\097\116\097")):ChangeStat(u,z,U)return"\083\117\099\099\101\115\115"end elseif z.Name=="\082\101\115\116\111\114\101\068\101\102\097\117\108\116\083\101\116\116\105\110\103\115"then local z="\083\117\099\099\101\115\115"for p,P in pairs(main.validSettings)do local U=main.settings[P]if U~=nil then(main:GetModule("\080\108\097\121\101\114\068\097\116\097")):ChangeStat(u,P,U)else z="\069\114\114\111\114"end end return z elseif z.Name=="\082\101\116\114\105\101\118\101\083\101\114\118\101\114\082\097\110\107\115"then local z={}for p,u in pairs(main.players:GetChildren())do local P=main.pd[u]if P and P.Rank>0 then local p=main.rankTypes[(main:GetModule("\099\102")):GetRankType(u)]table.insert(z,{Player=u,RankId=P.Rank;RankType=p})end end return z elseif z.Name=="\082\101\116\114\105\101\118\101\066\097\110\108\097\110\100"then local z={{};{}}local p=main.pd[u]if p and p.Rank>=main.settings.ViewBanland then local p={}local u={main.sd.Banland.Records;main.settingsBanRecords}for z,u in pairs(u)do for z,u in pairs(u)do table.insert(p,u)end end local P={main.serverBans,p}local U=os.time()local d={}for p,u in pairs(P)do for u,P in pairs(u)do local T=P.BanTime if(not tonumber(T)or U<T-30)and not d[P.UserId]then d[P.UserId]=true table.insert(z[p],P)end end end end return z elseif z.Name=="\082\101\116\114\105\101\118\101\082\097\110\107\115\073\110\102\111"then local z={}local p={}local P={}local U=main.pd[u]if U and main.sd.PermRanks then if U.Rank>=main.settings.RankRequiredToViewRankType.specificusers or 5 then z=main.sd.PermRanks.Records end for z,u in pairs(main.settings.Ranks)do local P=u[1]if U.Rank>=(main.settings.RankRequiredToViewRank[P]or 0)then table.insert(p,u)end end for z,p in pairs(main.permissions)do z=string.lower(z)local u=main.settings.RankRequiredToViewRankType[z]if U.Rank>=(u or 0)then P[z]=p end end end return{PermRanks=z,Ranks=p,Permissions=P}elseif z.Name=="\082\101\112\108\121\084\111\080\114\105\118\097\116\101\077\101\115\115\097\103\101"then local z=P[1]local p=main.permissionToReplyToPrivateMessage[z]if p and p[u]then main.permissionToReplyToPrivateMessage[z][u]=nil local p=(main:GetModule("\099\102")):FilterString(P[2],u,z);(main:GetModule("\099\102")):PrivateMessage(u,z,p)end elseif z.Name=="\082\101\109\111\118\101\080\101\114\109\082\097\110\107"then if U.Rank>=main.settings.RankRequiredToViewRankType.specificusers and U.Rank>=main.commandRanks.permrank then local z=P[1]local p=P[2]local U=main.sd.PermRanks.Records[(main:GetModule("\099\102")):FindUserIdInRecord(main.sd.PermRanks.Records,z)]if U then U.RemoveRank=true;(main:GetModule("\083\121\115\116\101\109\068\097\116\097")):InsertStat("\080\101\114\109\082\097\110\107\115","\082\101\099\111\114\100\115\084\111\077\111\100\105\102\121",U);(main:GetModule("\099\102")):FormatAndFireNotice(u,"\082\101\109\111\118\101\080\101\114\109\082\097\110\107",p)end end elseif z.Name=="\082\101\116\114\105\101\118\101\065\108\101\114\116\068\097\116\097"then if U.Rank>=main.commandRanks.globalalert then local z={Title=(main:GetModule("\099\102")):FilterBroadcast(P.Title or"",u),Message=(main:GetModule("\099\102")):FilterBroadcast(P.Message or"",u);Server=P.Server;PlayerArg=P.PlayerArg}alertData[u]=z return z end elseif z.Name=="\069\120\101\099\117\116\101\065\108\101\114\116"then local z=alertData[u]if z then local p="\065\108\101\114\116 \115\117\099\099\101\115\115\102\117\108\033"local P=z.Server if P=="\065\108\108"then p="\071\108\111\098\097\108 "..p main.messagingService:PublishAsync(topics.GlobalAlert,z)else local p=(main:GetModule("\081\117\097\108\105\102\105\101\114\115")):ParseQualifier(z.PlayerArg,u)for p,u in pairs(p)do main.signals.CreateAlert:FireClient(p,{z.Title,z.Message})end end main.signals.Notice:FireClient(u,{main.hdAdminCoreName,p})alertData[u]=nil return true end;(main:GetModule("\099\102")):FormatAndFireError(u,"\065\108\101\114\116\070\097\105\108")elseif z.Name=="\082\101\116\114\105\101\118\101\080\111\108\108\068\097\116\097"then if U.Rank>=main.commandRanks.vote then pollCount=pollCount+1 local z=tonumber(P.VoteTime)if not z then z=20 elseif z>60 then z=60 elseif z<1 then z=1 end local p=(main:GetModule("\099\102")):FilterBroadcast(P.Question or"",u)local U={}for z,p in pairs(P.Answers)do if z>10 then break end table.insert(U,(main:GetModule("\099\102")):FilterBroadcast(p or"",u))end if#U<1 then return"\077\117\115\116 \104\097\118\101 \097\116 \108\101\097\115\116 \049 \097\110\115\119\101\114\033"end local d=u.UserId local T=u.Name local D={VoteTime=z;Question=p,Answers=U,Server=P.Server,ShowResultsTo=P.ShowResultsTo,PlayerArg=P.PlayerArg;SenderName=u.Name;PollId=pollCount}pollData[u]=D return D end elseif z.Name=="\069\120\101\099\117\116\101\080\111\108\108"then local z=pollData[u]if z then local p="\080\111\108\108 \115\117\099\099\101\115\115\102\117\108\033 \084\104\101 \114\101\115\117\108\116\115 \119\105\108\108 \097\112\112\101\097\114 \115\104\111\114\116\108\121\046"local P=z.Server if P=="\065\108\108"then if U.Rank>=main.commandRanks.globalvote then spawn(function()p="\071\108\111\098\097\108 "..p local P={}for z=1,#z.Answers+1,1 do table.insert(P,0)end local U="\080\111\108\108"..z.PollId z.UniquePollTopic=U local d=0 local T=main.messagingService:SubscribeAsync(U,function(z)local p=z.Data for z,p in pairs(p)do P[z]=P[z]+p end d=d+1 end)main.messagingService:PublishAsync(topics.BeginPoll,z)local D=(main:GetModule("\099\102")):GetAmountOfServers()for z=1,z.VoteTime+2,1 do wait(1)if d>=D then break end end T:Disconnect()local B=0 for z,p in pairs(P)do if p>B then B=p end end z.Results={}for p=1,#z.Answers+1,1 do local u=z.Answers[p]local U=P[p]table.insert(z.Results,{Answer=u or"\068\105\100 \078\111\116 \086\111\116\101",Votes=U,Percentage=U/B})end if z.ShowResultsTo=="\089\111\117"then(main:GetModule("\099\102")):DisplayPollResults(u,z)else main.messagingService:PublishAsync(topics.DisplayPollResultsToServer,z)end end)end elseif U.Rank>=main.commandRanks.vote then spawn(function()local p=(main:GetModule("\081\117\097\108\105\102\105\101\114\115")):ParseQualifier(z.PlayerArg,u)local P={}for z,p in pairs(p)do table.insert(P,z)end local U=(main:GetModule("\099\102")):BeginPoll(z,P)local d=P if z.ShowResultsTo=="\089\111\117"then d={u}end for p,u in pairs(d)do(main:GetModule("\099\102")):DisplayPollResults(u,z)end end)else return false end pollData[u]=nil main.signals.Notice:FireClient(u,{main.hdAdminCoreName,p})return true end;(main:GetModule("\099\102")):FormatAndFireError(u,"\080\111\108\108\070\097\105\108")elseif z.Name=="\082\101\116\114\105\101\118\101\066\114\111\097\100\099\097\115\116\068\097\116\097"then if U.Rank>=main.commandRanks.globalannouncement then local z=P.Title local p=P.DisplayFrom local U=P.Color local d=P.Message if z~="\071\108\111\098\097\108 \065\110\110\111\117\110\099\101\109\101\110\116"then z=(main:GetModule("\099\102")):FilterBroadcast(z,u)end if type(p)~="\098\111\111\108\101\097\110"then p=true end U=(main:GetModule("\099\102")):GetColorFromString(U:match("\037\097\043"))if not U then U=Color3.fromRGB(255,255,255)end U={U.r,U.g,U.b}d=(main:GetModule("\099\102")):FilterBroadcast(d,u)local T=u.UserId local D=u.Name local B={Title=z;DisplayFrom=p;Color=U;Message=d,SenderId=u.UserId,SenderName=u.Name}broadcastData[u]=B return B end elseif z.Name=="\069\120\101\099\117\116\101\066\114\111\097\100\099\097\115\116"then if U.Rank>=main.commandRanks.globalannouncement then local z=broadcastData[u]if z then(main:GetModule("\083\121\115\116\101\109\068\097\116\097")):ChangeStat("\066\114\111\097\100\099\097\115\116","\066\114\111\097\100\099\097\115\116\068\097\116\097",z);(main:GetModule("\083\121\115\116\101\109\068\097\116\097")):ChangeStat("\066\114\111\097\100\099\097\115\116","\066\114\111\097\100\099\097\115\116\084\105\109\101",os.time());(main:GetModule("\083\121\115\116\101\109\068\097\116\097")):ChangeStat("\066\114\111\097\100\099\097\115\116","\066\114\111\097\100\099\097\115\116\073\100",math.random(1,10000000));(main:GetModule("\099\102")):FormatAndFireNotice(u,"\066\114\111\097\100\099\097\115\116\083\117\099\099\101\115\115\102\117\108")broadcastData[u]=nil return true end end;(main:GetModule("\099\102")):FormatAndFireNotice(u,"\066\114\111\097\100\099\097\115\116\070\097\105\108\101\100")elseif z.Name=="\071\101\116\080\105\110\103"then return P end end end elseif p:IsA("\082\101\109\111\116\101\069\118\101\110\116")then local z=p z.OnServerEvent:Connect(function(u,P,U)local d=main.pd[u]if d and checkRemoteLimit(u,p)then if z.Name=="\082\101\112\108\105\099\097\116\101\069\102\102\101\099\116"then local z=main.commands[string.lower(P)]if z and z.ReplicationEffect then for z,p in pairs(main.players:GetChildren())do local d=(main:GetModule("\099\102")):GetHead(p)if p~=u and(d and u:DistanceFromCharacter(d.Position)<=100)then main.signals.ReplicationEffectClientCommand:FireClient(p,{P,u;U})end end end end end end)end end

for _, object in pairs(main.signals:GetChildren()) do
	
	--Remove functions
	if object:IsA("RemoteFunction") then
		local rfunction = object
		function rfunction.OnServerInvoke(player,args,...)
			local pdata = main.pd[player]
			if pdata then
				
				--Sanity Checks
				checkRemoteLimit(player, object)
				
				---------------------------------------------
				if rfunction.Name == "RetrieveData" then
					
					if not main.initialized then
						main.signals.Initialized.Event:Wait()
					end
					if not pdata or not pdata.SetupData then
						repeat wait(0.1) pdata = main.pd[player] until (pdata and pdata.SetupData) or not player
					end
					local dataToReturn = {
						["pdata"] = pdata;
						permissions = main.permissions;
						commandInfo = main.commandInfo;
						commandRanks = main.commandRanks;
						infoOnAllCommands = main.infoOnAllCommands;
						settings = {
							Ranks = main.settings.Ranks;
							UniversalPrefix = main.settings.UniversalPrefix;
							Colors = main.settings.Colors;
							ThemeColors = main.settings.ThemeColors;
							Cmdbar = main.settings.Cmdbar;
							Cmdbar2 = main.settings.Cmdbar2;
							ViewBanland = main.settings.ViewBanland;
							DisableAllNotices = main.settings.DisableAllNotices;
							RankRequiredToViewPage = main.settings.RankRequiredToViewPage;
							OnlyShowUsableCommands = main.settings.OnlyShowUsableCommands;
							CommandLimits = main.settings.CommandLimits;
							RankRequiredToViewIcon = main.settings.RankRequiredToViewIcon;
							};
						morphNames = main.morphNames;
						toolNames = main.toolNames;
						ownerName = main.ownerName;
						ownerId = main.ownerId;
						gameName = main.gameName;
						hdAdminGroup = main.hdAdminGroup;
						};
					return dataToReturn
				
				
				---------------------------------------------	
				elseif rfunction.Name == "RequestCommand" then
					local success = main:GetModule("Parser"):ParseMessage(player, args, false, ...)
					return success
				
				
				---------------------------------------------
				elseif rfunction.Name == "ChangeSetting" then
					local settingName = args[1]
					local settingValue = main.settings[settingName]
					local newValue = args[2]
					if main:GetModule("cf"):FindValue(main.validSettings, settingName) then
						if settingName == "Prefix" then
							if #newValue ~= 1 then
								return "Prefix can only be 1 character!"
							elseif newValue == main.settings.UniversalPrefix then
								return "Cannot set to the UniversalPrefix!"
							end
						elseif string.sub(settingName, -7) == "SoundId" and not main:GetModule("cf"):CheckIfValidSound(newValue) then
							return "Invalid sound!"
						elseif tonumber(settingValue) and not tonumber(newValue) then
							return "Invalid number!"
						end
						main:GetModule("PlayerData"):ChangeStat(player, settingName, newValue)
						return "Success" 
					end
				
				
				---------------------------------------------	
				elseif rfunction.Name == "RestoreDefaultSettings" then
					local success = "Success"
					for i,v in pairs(main.validSettings) do
						local originalSetting = main.settings[v]
						if originalSetting ~= nil then
							main:GetModule("PlayerData"):ChangeStat(player, v, originalSetting)
						else
							success = "Error"
						end
					end
					return success
					
					
				---------------------------------------------
				elseif rfunction.Name == "RetrieveServerRanks" then
					local serverRankInfo = {}
					for i, plr in pairs(main.players:GetChildren()) do
						local pdata = main.pd[plr]
						if pdata and pdata.Rank > 0 then
							local rankType = main.rankTypes[main:GetModule("cf"):GetRankType(plr)]
							table.insert(serverRankInfo, {Player = plr, RankId = pdata.Rank, RankType = rankType})
						end
					end
					return serverRankInfo
					
				
				---------------------------------------------
				elseif rfunction.Name == "RetrieveBanland" then
					local banlandInfo = {{},{}}
					local pdata = main.pd[player]
					if pdata and pdata.Rank >= main.settings.ViewBanland then
						local allServerBans = {}
						local allServerBanRecordsToMerge = {main.sd.Banland.Records, main.settingsBanRecords}
						for _, records in pairs(allServerBanRecordsToMerge) do
							for i, record in pairs(records) do
								table.insert(allServerBans, record)
							end
						end
						local toScan = {main.serverBans, allServerBans}
						local timeNow = os.time()
						local usersAdded = {}
						for section, records in pairs(toScan) do
							for i, record in pairs(records) do
								local banTime = record.BanTime
								if (not tonumber(banTime) or timeNow < (banTime-30)) and not usersAdded[record.UserId] then
									usersAdded[record.UserId] = true
									table.insert(banlandInfo[section], record)
								end
							end
						end
					end
					return banlandInfo 
					
				
				---------------------------------------------
				elseif rfunction.Name == "RetrieveRanksInfo" then
					
					local permRanksInfo = {}
					local ranks = {}
					local permissions = {}
					local pdata = main.pd[player]
					if pdata and main.sd.PermRanks  then
						
						--PermRanksInfo
						if pdata.Rank >= main.settings.RankRequiredToViewRankType.specificusers or 5 then
							permRanksInfo = main.sd.PermRanks.Records
						end
						
						--Ranks
						for i,v in pairs(main.settings.Ranks) do
							local rankId = v[1]
							if pdata.Rank >= (main.settings.RankRequiredToViewRank[rankId] or 0) then
								table.insert(ranks, v)
							end
						end
						
						--Permissions
						for pName, pDetails in pairs(main.permissions) do
							pName = string.lower(pName)
							local pRank = main.settings.RankRequiredToViewRankType[pName]
							if pdata.Rank >= (pRank or 0) then
								permissions[pName] = pDetails
							end
						end
						
					end
					
					return {
						["PermRanks"] = permRanksInfo;
						["Ranks"] = ranks;
						["Permissions"] = permissions;
					} 
					
				
				---------------------------------------------
				elseif rfunction.Name == "ReplyToPrivateMessage" then
					local targetPlr = args[1]
					local targetPlrPerms = main.permissionToReplyToPrivateMessage[targetPlr]
					if targetPlrPerms and targetPlrPerms[player] then
						main.permissionToReplyToPrivateMessage[targetPlr][player] = nil
						local replyMessage = main:GetModule("cf"):FilterString(args[2], player, targetPlr)
						main:GetModule("cf"):PrivateMessage(player, targetPlr, replyMessage)
					end
				
				
				
				---------------------------------------------
				elseif rfunction.Name == "RemovePermRank" then
					if pdata.Rank >= main.settings.RankRequiredToViewRankType.specificusers and pdata.Rank >= main.commandRanks.permrank then
						local userId = args[1]
						local userName = args[2]
						local record = main.sd.PermRanks.Records[main:GetModule("cf"):FindUserIdInRecord(main.sd.PermRanks.Records, userId)]
						if record then
							record.RemoveRank = true
							main:GetModule("SystemData"):InsertStat("PermRanks", "RecordsToModify", record)
							main:GetModule("cf"):FormatAndFireNotice(player, "RemovePermRank", userName)
						end
					end
				
				
				---------------------------------------------
				elseif rfunction.Name == "RetrieveAlertData" then
					if pdata.Rank >= main.commandRanks.globalalert then
						local data = {
							["Title"] = main:GetModule("cf"):FilterBroadcast(args.Title or "", player),
							["Message"] = main:GetModule("cf"):FilterBroadcast(args.Message or "", player),
							["Server"] = args.Server,
							["PlayerArg"] = args.PlayerArg
							}
						alertData[player] = data
						return data
					end
				
				
				---------------------------------------------
				elseif rfunction.Name == "ExecuteAlert" then
					local data = alertData[player]
					if data then
						local successMessage = "Alert successful!"
						local server = data.Server
						
						-- << GLOBAL VOTE >>
						if server == "All" then
							successMessage = "Global "..successMessage
							main.messagingService:PublishAsync(topics.GlobalAlert, data)
						
						
						-- << SERVER VOTE >>
						else
							local targetPlayers = main:GetModule("Qualifiers"):ParseQualifier(data.PlayerArg, player)
							for plr,_ in pairs(targetPlayers) do
								main.signals.CreateAlert:FireClient(plr, {data.Title, data.Message})
							end
							
							
						end
						main.signals.Notice:FireClient(player, {main.hdAdminCoreName, successMessage})
						alertData[player] = nil
						return true
					end
					main:GetModule("cf"):FormatAndFireError(player, "AlertFail")
					
				
				---------------------------------------------
				elseif rfunction.Name == "RetrievePollData" then
					if pdata.Rank >= main.commandRanks.vote then
						pollCount = pollCount + 1
						--local server = (type(args.Server) == "boolean" and args.Server) or true
						local voteTime = tonumber(args.VoteTime)
						if not voteTime then
							voteTime = 20
						elseif voteTime > 60 then
							voteTime = 60
						elseif voteTime < 1 then
							voteTime = 1
						end
						local question = main:GetModule("cf"):FilterBroadcast(args.Question or "", player)
						local answers = {}
						for i, answer in pairs(args.Answers) do
							if i > 10 then
								break
							end
							table.insert(answers, main:GetModule("cf"):FilterBroadcast(answer or "", player))
						end
						if #answers < 1 then
							return "Must have at least 1 answer!"
						end
						local senderId = player.UserId
						local senderName = player.Name
						local data = {
							["VoteTime"] = voteTime,
							["Question"] = question,
							["Answers"] = answers,
							["Server"] = args.Server,
							["ShowResultsTo"] = args.ShowResultsTo,
							["PlayerArg"] = args.PlayerArg,
							["SenderName"] = player.Name,
							["PollId"] = pollCount
							}
						pollData[player] = data
						return data
					end
				
				
				---------------------------------------------
				elseif rfunction.Name == "ExecutePoll" then
					local data = pollData[player]
					if data then
						local successMessage = "Poll successful! The results will appear shortly."
						local server = data.Server
						
						-- << GLOBAL VOTE >>
						if server == "All" then
							if pdata.Rank >= main.commandRanks.globalvote then
								spawn(function()
									successMessage = "Global "..successMessage
									
									--Setup topic and SubscribeAsync
									local scores = {}
									for i = 1, #data.Answers+1 do
										table.insert(scores, 0)
									end
									local uniquePollTopic = "Poll"..data.PollId
									data.UniquePollTopic = uniquePollTopic
									local serversResponded = 0
									local subFunc = main.messagingService:SubscribeAsync(uniquePollTopic, function(message)
										local serverScores = message.Data
										for i,v in pairs(serverScores) do
											scores[i] = scores[i] + v
										end
										serversResponded = serversResponded + 1
									end)
									
									--Begin polls for all servers
									main.messagingService:PublishAsync(topics.BeginPoll, data)
									local totalServers = main:GetModule("cf"):GetAmountOfServers()
									for i = 1, data.VoteTime+2 do
										wait(1)
										if serversResponded >= totalServers then
											break
										end
									end
									subFunc:Disconnect()
									
									--Calculate results
									local highestScore = 0
									for i,v in pairs(scores) do
										if v > highestScore then
											highestScore = v
										end
									end
									data.Results = {}
									for i = 1, #data.Answers+1 do
										local answer = data.Answers[i]
										local answerVotes = scores[i]
										table.insert(data.Results, {
												Answer = answer or "Did Not Vote";
												Votes = answerVotes;
												Percentage = answerVotes/highestScore;
											}
										)
									end
									
									--Display results
									if data.ShowResultsTo == "You" then
										main:GetModule("cf"):DisplayPollResults(player, data)
									else
										main.messagingService:PublishAsync(topics.DisplayPollResultsToServer, data)
									end
								end)
								
							end
						
						
						-- << SERVER VOTE >>
						elseif pdata.Rank >= main.commandRanks.vote then
							spawn(function()
								--Get participants
								local targetPlayers = main:GetModule("Qualifiers"):ParseQualifier(data.PlayerArg, player)
								local participants = {}
								for plr,_ in pairs(targetPlayers) do
									table.insert(participants, plr)
								end
								
								--Setup poll and retrieve data
								local newData = main:GetModule("cf"):BeginPoll(data, participants)
								
								--Display results
								local showResultsToTable = participants
								if data.ShowResultsTo == "You" then
									showResultsToTable = {player}
								end
								for i, plr in pairs(showResultsToTable) do
									main:GetModule("cf"):DisplayPollResults(plr, data)
								end
							end)
							
							
						else
							return false
						end
						pollData[player] = nil
						main.signals.Notice:FireClient(player, {main.hdAdminCoreName, successMessage})
						return true
					end
					main:GetModule("cf"):FormatAndFireError(player, "PollFail")
					
				---------------------------------------------
				elseif rfunction.Name == "RetrieveBroadcastData" then
					if pdata.Rank >= main.commandRanks.globalannouncement then
						local title = args.Title
						local displayFrom = args.DisplayFrom
						local color = args.Color
						local message = args.Message
						if title ~= "Global Announcement" then
							title = main:GetModule("cf"):FilterBroadcast(title, player)
						end
						if type(displayFrom) ~= "boolean" then
							displayFrom = true
						end
						color = main:GetModule("cf"):GetColorFromString(color:match("%a+"))
						if not color then
							color = Color3.fromRGB(255,255,255)
						end
						color = {color.r, color.g, color.b}
						message = main:GetModule("cf"):FilterBroadcast(message, player)
						local senderId = player.UserId
						local senderName = player.Name
						local data = {
							["Title"] = title,
							["DisplayFrom"] = displayFrom,
							["Color"] = color,
							["Message"] = message,
							["SenderId"] = player.UserId,
							["SenderName"] = player.Name
							}
						broadcastData[player] = data
						return data
					end --RetrievePollData
				
				
				---------------------------------------------
				elseif rfunction.Name == "ExecuteBroadcast" then
					if pdata.Rank >= main.commandRanks.globalannouncement then
						local data = broadcastData[player]
						if data then
							main:GetModule("SystemData"):ChangeStat("Broadcast", "BroadcastData", data)
							main:GetModule("SystemData"):ChangeStat("Broadcast", "BroadcastTime", os.time())
							main:GetModule("SystemData"):ChangeStat("Broadcast", "BroadcastId", math.random(1,10000000))
							main:GetModule("cf"):FormatAndFireNotice(player, "BroadcastSuccessful")
							broadcastData[player] = nil
							return true
						end
					end
					main:GetModule("cf"):FormatAndFireNotice(player, "BroadcastFailed")
					
					
				---------------------------------------------
				elseif rfunction.Name == "GetPing" then
					return args
					
				---------------------------------------------
				end
			end
		end
			
		
		
		
		
		
		
		
		
		
		
		
		
	--Remote events
	elseif object:IsA("RemoteEvent") then
		local revent = object
		revent.OnServerEvent:Connect(function(player, commandName, args)
			local pdata = main.pd[player]
			if pdata and checkRemoteLimit(player, object) then
				---------------------------------------------
				if revent.Name == "ReplicateEffect" then
					local command = main.commands[string.lower(commandName)]
					if command and command.ReplicationEffect then
						for i, plr in pairs(main.players:GetChildren()) do
							local plrHead = main:GetModule("cf"):GetHead(plr)
							if plr ~= player and plrHead and player:DistanceFromCharacter(plrHead.Position) <= 100 then
								main.signals.ReplicationEffectClientCommand:FireClient(plr, {commandName, player, args})
							end
						end
					end
				end
				
				
				---------------------------------------------
			end
		end)
	end
	
end


