local z=require(script.Parent.Parent.Shared.Util)local s=game:GetService("\080\108\097\121\101\114\115")local B={Transform=function(B)local o=z.MakeFuzzyFinder(s:GetPlayers())return o(B)end,Validate=function(z)return#z>0,"\078\111 \112\108\097\121\101\114 \119\105\116\104 \116\104\097\116 \110\097\109\101 \099\111\117\108\100 \098\101 \102\111\117\110\100\046"end,Autocomplete=function(s)return z.GetNames(s)end,Parse=function(z)return z[1]end,Default=function(z)return z.Name end,ArgumentOperatorAliases={me="\046",all="\042",others="\042\042";random="\063"}}return function(s)s:RegisterType("\112\108\097\121\101\114",B)s:RegisterType("\112\108\097\121\101\114\115",z.MakeListableType(B,{Prefixes="\037 \116\101\097\109\080\108\097\121\101\114\115"}))end
local Util = require(script.Parent.Parent.Shared.Util)
local Players = game:GetService("Players")

local playerType = {
	Transform = function(text)
		local findPlayer = Util.MakeFuzzyFinder(Players:GetPlayers())

		return findPlayer(text)
	end,

	Validate = function(players)
		return #players > 0, "No player with that name could be found."
	end,

	Autocomplete = function(players)
		return Util.GetNames(players)
	end,

	Parse = function(players)
		return players[1]
	end,

	Default = function(player)
		return player.Name
	end,

	ArgumentOperatorAliases = {
		me = ".",
		all = "*",
		others = "**",
		random = "?",
	},
}

return function(cmdr)
	cmdr:RegisterType("player", playerType)
	cmdr:RegisterType(
		"players",
		Util.MakeListableType(playerType, {
			Prefixes = "% teamPlayers",
		})
	)
end
