function module.Process(Z,K,h,R,V,m,B,d,p,Q,e)local r={}local F={}local M=false local L=false if R==main.settings.UniversalPrefix then M=true end for K,h in pairs(K)do if K~=1 or h~="\112\108\097\121\101\114"or not M then table.insert(F,h)end end for K,R in pairs(F)do local Z=h[K]if R=="\114\097\110\107"then local K=6 if Z~=nil then for h,R in pairs(main.settings.Ranks)do local V=R[1]local m=R[2]if string.lower(m)==Z then K=V break end end if K==6 then for h,R in pairs(main.settings.Ranks)do local V=R[1]local m=R[2]if string.sub(string.lower(m),1,#Z)==Z then K=V break end end end end Z=K elseif R=="\099\111\108\111\117\114"or R=="\099\111\108\111\114"or R=="\099\111\108\111\114\051"then local K if Z~=nil then local h={}Z:gsub("\040\091\094\044\093\043\041",function(K)table.insert(h,tonumber(K))end)if#h==3 then K=Color3.fromRGB(h[1],h[2],h[3])else K=(main:GetModule("\099\102")):GetColorFromString(Z)end end if not K then if V=="\108\097\115\101\114\069\121\101\115"then K=B.LaserColor else K=Color3.fromRGB(255,255,255)end end Z=K elseif R=="\110\117\109\098\101\114"or R=="\105\110\116\101\103\101\114"or R=="\115\116\117\100\115"or R=="\115\112\101\101\100"or R=="\105\110\116\101\110\115\105\116\121"then Z=tonumber(Z)or 0 local K=main.settings.CommandLimits[V]if K then local h=K.Limit local V=K.IgnoreLimit if Z>h and B.Rank<V then local K=(main:GetModule("\099\102")):GetRankName(V);(main:GetModule("\099\102")):FormatAndFireError(m,"\067\111\109\109\097\110\100\076\105\109\105\116",R,h,K)L=true end end elseif R=="\098\111\111\108\101\097\110"then Z=(Z=="\111\110"or Z=="\116\114\117\101")and true or false elseif R=="\118\097\108\117\101"then local K=tonumber(Z)if K then Z=K end elseif R=="\115\116\097\116"or R=="\115\116\097\116\110\097\109\101"then local K=""local h=m:FindFirstChild("\108\101\097\100\101\114\115\116\097\116\115")if h then for h,R in pairs(h:GetChildren())do local V=string.lower(R.Name)if string.sub(V,1,#Z)==Z then K=R.Name break end end end Z=K elseif R=="\115\099\097\108\101"then Z=tonumber(Z)or 1 local K=main.settings.ScaleLimit local h=main.settings.IgnoreScaleLimit if Z>K and B.Rank<h then local R=(main:GetModule("\099\102")):GetRankName(h);(main:GetModule("\099\102")):FormatAndFireError(m,"\083\099\097\108\101\076\105\109\105\116",K,R)L=true elseif Z>50 then Z=100 end elseif R=="\100\101\103\114\101\101\115"or R=="\100\101\103\114\101\101"or R=="\114\111\116\097\116\105\111\110"then Z=tonumber(Z)or 180 elseif R=="\116\101\097\109"then local K for h,R in pairs(main.teams:GetChildren())do local V=string.lower(R.Name)if string.sub(V,1,#Z)==Z then K=R break end end Z=K elseif R=="\116\101\097\109\099\111\108\111\114"then local K for h,R in pairs(main.teams:GetChildren())do local V=string.lower(R.Name)if string.sub(V,1,#Z)==Z then K=R.TeamColor break end end Z=K elseif R=="\116\101\120\116"or R=="\115\116\114\105\110\103"or R=="\114\101\097\115\111\110"or R=="\113\117\101\115\116\105\111\110"or R=="\116\101\097\109\110\097\109\101"or R=="\099\111\100\101"then local K,h=(string.lower(d)):find(p)if Z then local K=string.sub(d,h+1)local V,B=(string.lower(K)):find(Z,1,true)local p=string.sub(K,V)if e~=#Q then local K=e+1 for h,R in pairs(Q)do if h>=K then table.remove(Q,K)end end end Z=string.sub(Z,1,420)if tonumber(p)or R=="\099\111\100\101"then Z=p else Z=(main:GetModule("\099\102")):FilterBroadcast(p,m)end else Z=" "end elseif R=="\097\110\115\119\101\114\115"then local K={}if Z then Z:gsub("\040\091\094\044\093\043\041",function(h)K[#K+1]=h end)Z=K end elseif R=="\109\097\116\101\114\105\097\108"then local K=Enum.Material.Plastic for h,R in pairs(materials)do if Z==string.sub(string.lower(R),1,#Z)then K=Enum.Material[R]break end end Z=K elseif R=="\117\115\101\114\105\100"or R=="\112\108\097\121\101\114\105\100"or R=="\112\108\114\105\100"then if Z==nil then Z=1 end local K=tonumber(Z)if not K then local h=string.lower(Z)for R,V in pairs(main.players:GetChildren())do local m=string.lower(V.Name)if string.sub(m,1,#h)==h then K=V.UserId end end if not K then K=(main:GetModule("\099\102")):GetUserId(Z)end end Z=K elseif R=="\116\111\111\108\115"or R=="\103\101\097\114\115"or R=="\116\111\111\108"or R=="\103\101\097\114"then local K=Z Z={}for h,R in pairs(main.listOfTools)do if K=="\097\108\108"or string.lower(string.sub(R.Name,1,#K))==K then table.insert(Z,R)end end elseif R=="\109\111\114\112\104"then local K=Z Z=nil if K then for h,R in pairs(main.server.Morphs:GetChildren())do local V=string.lower(R.Name)if V==K then Z=R break elseif string.sub(V,1,#K)==K then Z=R end end end end if L then break end table.insert(r,Z)end return r,L end return module

function module:Process(commandArgsReal, args, commandPrefix, commandName, speaker, speakerData, originalMessage, originalAlias, batches, batchPos)
	local argsToReturn = {}
	local commandArgs = {}
	local UP = false
	local forceExit = false
	if commandPrefix == main.settings.UniversalPrefix then
		UP = true
	end
	for i,v in pairs(commandArgsReal) do
		if i ~= 1 or v ~= "player" or not UP then
			table.insert(commandArgs, v)
		end
	end
	for i,v in pairs(commandArgs) do
		local argToProcess = args[i]
		
		if v == "rank" then
			local finalRankId = 6 -- Any rank higher than 5 will not be given
			if argToProcess ~= nil then
				for _, rankDetails in pairs(main.settings.Ranks) do
					local rankId = rankDetails[1]
					local rankName = rankDetails[2]
					if string.lower(rankName) == argToProcess then
						finalRankId = rankId
						break
					end
				end
				if finalRankId == 6 then
					for _, rankDetails in pairs(main.settings.Ranks) do
						local rankId = rankDetails[1]
						local rankName = rankDetails[2]
						if string.sub(string.lower(rankName),1,#argToProcess) == argToProcess then
							finalRankId = rankId
							break
						end
					end
				end
			end
			argToProcess = finalRankId
			
		elseif v == "colour" or v == "color" or v == "color3" then
			local finalColor
			if argToProcess ~= nil then
				local rgb = {}
				argToProcess:gsub("([^,]+)",function(c) table.insert(rgb, tonumber(c)) end);
				if #rgb == 3 then
					finalColor = Color3.fromRGB(rgb[1], rgb[2], rgb[3])
				else
					finalColor = main:GetModule("cf"):GetColorFromString(argToProcess)
				end
			end
			if not finalColor then
				if commandName == "laserEyes" then
					finalColor = speakerData.LaserColor
				else
					finalColor = Color3.fromRGB(255,255,255)
				end
			end
			argToProcess = finalColor
			
		elseif v == "number" or v == "integer" or v == "studs" or v == "speed" or v == "intensity" then
			argToProcess = tonumber(argToProcess) or 0
			local limitDetails = main.settings.CommandLimits[commandName]
			if limitDetails then
				local limit = limitDetails.Limit
				local ingoreRank = limitDetails.IgnoreLimit
				if argToProcess > limit and speakerData.Rank < ingoreRank then
					local rankName = main:GetModule("cf"):GetRankName(ingoreRank)
					main:GetModule("cf"):FormatAndFireError(speaker, "CommandLimit", v, limit, rankName)
					forceExit = true
				end
			end
			
		elseif v == "boolean" then
			argToProcess = ((argToProcess == "on" or argToProcess == "true") and true) or false
			
		elseif v == "value" then
			local number = tonumber(argToProcess)
			if number then
				argToProcess = number
			end
		
		elseif v == "stat" or v == "statname" then
			local finalStatName = ""
			local leaderstats = speaker:FindFirstChild("leaderstats")
			if leaderstats then
				for _,stat in pairs(leaderstats:GetChildren()) do
					local statName = string.lower(stat.Name)
					if string.sub(statName, 1, #argToProcess) == argToProcess then
						finalStatName = stat.Name
						break
					end
				end
			end
			argToProcess = finalStatName
			
		elseif v == "scale" then
			argToProcess = tonumber(argToProcess) or 1
			local scaleLimit = main.settings.ScaleLimit
			local ignoreRank = main.settings.IgnoreScaleLimit
			if argToProcess > scaleLimit and speakerData.Rank < ignoreRank then
				local rankName = main:GetModule("cf"):GetRankName(ignoreRank)
				main:GetModule("cf"):FormatAndFireError(speaker, "ScaleLimit", scaleLimit, rankName)
				forceExit = true
			elseif argToProcess > 50 then
				argToProcess = 100
			end
			--
			
		elseif v == "degrees" or v == "degree" or v == "rotation" then
			argToProcess = tonumber(argToProcess) or 180
		
		elseif v == "team" then
			local selectedTeam
			for _,team in pairs(main.teams:GetChildren()) do
				local teamName = string.lower(team.Name)
				if string.sub(teamName, 1, #argToProcess) == argToProcess then
					selectedTeam = team
					break
				end
			end
			argToProcess = selectedTeam
		
		elseif v == "teamcolor" then
			local teamColor
			for _,team in pairs(main.teams:GetChildren()) do
				local teamName = string.lower(team.Name)
				if string.sub(teamName, 1, #argToProcess) == argToProcess then
					teamColor = team.TeamColor
					break
				end
			end
			argToProcess = teamColor
			
		elseif v == "text" or v == "string" or v == "reason" or v == "question" or v == "teamname" or v == "code" then
			local _, minStartPos = string.lower(originalMessage):find(originalAlias)
			if argToProcess then
				local newOriginalMessage = string.sub(originalMessage, minStartPos+1)
				local startPos, endPos = string.lower(newOriginalMessage):find(argToProcess, 1, true)
				local message = string.sub(newOriginalMessage, startPos)
				if batchPos ~= #batches then
					local removeFrom = batchPos+1
					for i,v in pairs(batches) do
						if i >= removeFrom then
							table.remove(batches,removeFrom)
						end
					end
				end
				argToProcess = string.sub(argToProcess, 1, 420) -- We don't people flooding items like titles with over 20,000 characters for example
				if tonumber(message) or v == "code" then
					argToProcess = message
				else
					argToProcess = main:GetModule("cf"):FilterBroadcast(message, speaker)
				end
			else
				argToProcess = " "
			end
			
		elseif v == "answers" then
			local newArgs = {}
			if argToProcess then
				argToProcess:gsub('([^,]+)',function(c) newArgs[#newArgs+1] = c end);
				argToProcess = newArgs
			end
			
		elseif v == "material" then
			local finalMaterial = Enum.Material.Plastic
			for i, materialName in pairs(materials) do
				if (argToProcess == string.sub(string.lower(materialName),1,#argToProcess)) then
					finalMaterial = Enum.Material[materialName]
					break
				end
			end
			argToProcess = finalMaterial
		
		elseif v == "userid" or v == "playerid" or v == "plrid" then
			if argToProcess == nil then
				argToProcess = 1
			end
			local userId = tonumber(argToProcess)
			if not userId then
				local userName = string.lower(argToProcess)
				for i, plr in pairs(main.players:GetChildren()) do
					local plrName = string.lower(plr.Name)
					if string.sub(plrName, 1, #userName) == userName then
						userId = plr.UserId
					end
				end
				if not userId then
					userId = main:GetModule("cf"):GetUserId(argToProcess)
				end
			end
			argToProcess = userId
		
		elseif v == "tools" or v == "gears" or v == "tool" or v == "gear" then
			local toolName = argToProcess
			argToProcess = {}
			for i,v in pairs(main.listOfTools) do
				if toolName == "all" or string.lower(string.sub(v.Name, 1, #toolName)) == toolName then
					table.insert(argToProcess, v)
				end
			end
		
		elseif v == "morph" then
			local morphName = argToProcess
			argToProcess = nil
			if morphName then
				for i,v in pairs(main.server.Morphs:GetChildren()) do
					local mName = string.lower(v.Name)
					if mName == morphName then
						argToProcess = v
						break
					elseif string.sub(mName, 1, #morphName) == morphName then
						argToProcess = v
					end
				end
			end
			
		end
		if forceExit then
			break
		end
		table.insert(argsToReturn, argToProcess)
	end
	
	return argsToReturn, forceExit
end



return module
