function Registry.RegisterCommandObject(B,E,T)for T in pairs(E)do if B.CommandMethods[T]==nil then error("\085\110\107\110\111\119\110 \107\101\121\047\109\101\116\104\111\100 \105\110 \099\111\109\109\097\110\100 "..((E.Name or"\117\110\107\110\111\119\110 \099\111\109\109\097\110\100")..("\058 "..T)))end end if E.Args then for T,u in pairs(E.Args)do if type(u)=="\116\097\098\108\101"then for u in pairs(u)do if B.CommandArgProps[u]==nil then error(("\085\110\107\110\111\119\110 \112\114\111\112\101\114\116\121 \105\110 \099\111\109\109\097\110\100 \"\037\115\" \097\114\103\117\109\101\110\116 \035\037\100\058 \037\115"):format(E.Name or"\117\110\107\110\111\119\110",T,u))end end end end end if E.AutoExec and RunService:IsClient()then table.insert(B.AutoExecBuffer,E.AutoExec)B:FlushAutoExecBufferDeferred()end local u=B.Commands[E.Name:lower()]if u and u.Aliases then for E,T in pairs(u.Aliases)do B.Commands[T:lower()]=nil end elseif not u then table.insert(B.CommandsArray,E)end B.Commands[E.Name:lower()]=E if E.Aliases then for T,u in pairs(E.Aliases)do B.Commands[u:lower()]=E end end end

function Registry:RegisterCommandObject (commandObject, fromCmdr)
	for key in pairs(commandObject) do
		if self.CommandMethods[key] == nil then
			error("Unknown key/method in command " .. (commandObject.Name or "unknown command") .. ": " .. key)
		end
	end

	if commandObject.Args then
		for i, arg in pairs(commandObject.Args) do
			if type(arg) == "table" then
				for key in pairs(arg) do
					if self.CommandArgProps[key] == nil then
						error(('Unknown property in command "%s" argument #%d: %s'):format(commandObject.Name or "unknown", i, key))
					end
				end
			end
		end
	end

	if commandObject.AutoExec and RunService:IsClient() then
		table.insert(self.AutoExecBuffer, commandObject.AutoExec)
		self:FlushAutoExecBufferDeferred()
	end

	-- Unregister the old command if it exists...
	local oldCommand = self.Commands[commandObject.Name:lower()]
	if oldCommand and oldCommand.Aliases then
		for _, alias in pairs(oldCommand.Aliases) do
			self.Commands[alias:lower()] = nil
		end
	elseif not oldCommand then
		table.insert(self.CommandsArray, commandObject)
	end

	self.Commands[commandObject.Name:lower()] = commandObject

	if commandObject.Aliases then
		for _, alias in pairs(commandObject.Aliases) do
			self.Commands[alias:lower()] = commandObject
		end
	end
end
