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