function Command.Run(L)if L._Validated==nil then error("\077\117\115\116 \118\097\108\105\100\097\116\101 \097 \099\111\109\109\097\110\100 \098\101\102\111\114\101 \114\117\110\110\105\110\103\046")end local A=L.Dispatcher:RunHooks("\066\101\102\111\114\101\082\117\110",L)if A then return A end if not IsServer and(L.Object.Data and L.Data==nil)then local A,g=L:GatherArgumentValues()L.Data=L.Object.Data(L,unpack(A,1,g))end if not IsServer and L.Object.ClientRun then local A,g=L:GatherArgumentValues()L.Response=L.Object.ClientRun(L,unpack(A,1,g))end if L.Response==nil then if L.Object.Run then local A,g=L:GatherArgumentValues()L.Response=L.Object.Run(L,unpack(A,1,g))elseif IsServer then if L.Object.ClientRun then warn(L.Name,"\099\111\109\109\097\110\100 \102\101\108\108 \098\097\099\107 \116\111 \116\104\101 \115\101\114\118\101\114 \098\101\099\097\117\115\101 \067\108\105\101\110\116\082\117\110 \114\101\116\117\114\110\101\100 \110\105\108\044 \098\117\116 \116\104\101\114\101 \105\115 \110\111 \115\101\114\118\101\114 \105\109\112\108\101\109\101\110\116\097\116\105\111\110\033 \069\105\116\104\101\114 \114\101\116\117\114\110 \097 \115\116\114\105\110\103 \102\114\111\109 \067\108\105\101\110\116\082\117\110\044 \111\114 \099\114\101\097\116\101 \097 \115\101\114\118\101\114 \105\109\112\108\101\109\101\110\116\097\116\105\111\110 \102\111\114 \116\104\105\115 \099\111\109\109\097\110\100\046")else warn(L.Name,"\099\111\109\109\097\110\100 \104\097\115 \110\111 \105\109\112\108\101\109\101\110\116\097\116\105\111\110\033")end L.Response="\078\111 \105\109\112\108\101\109\101\110\116\097\116\105\111\110\046"else L.Response=L.Dispatcher:Send(L.RawText,L.Data)end end local g=L.Dispatcher:RunHooks("\065\102\116\101\114\082\117\110",L)if g then return g else return L.Response end end
--- Runs the command. Handles dispatching to the server if necessary.
-- Command:Validate() must be called before this is called or it will throw.
function Command:Run()
	if self._Validated == nil then
		error("Must validate a command before running.")
	end

	local beforeRunHook = self.Dispatcher:RunHooks("BeforeRun", self)
	if beforeRunHook then
		return beforeRunHook
	end

	if not IsServer and self.Object.Data and self.Data == nil then
		local values, length = self:GatherArgumentValues()
		self.Data = self.Object.Data(self, unpack(values, 1, length))
	end

	if not IsServer and self.Object.ClientRun then
		local values, length = self:GatherArgumentValues()
		self.Response = self.Object.ClientRun(self, unpack(values, 1, length))
	end

	if self.Response == nil then
		if self.Object.Run then -- We can just Run it here on this machine
			local values, length = self:GatherArgumentValues()
			self.Response = self.Object.Run(self, unpack(values, 1, length))
		elseif IsServer then -- Uh oh, we're already on the server and there's no Run function.
			if self.Object.ClientRun then
				warn(
					self.Name,
					"command fell back to the server because ClientRun returned nil, but there is no server implementation! Either return a string from ClientRun, or create a server implementation for this command."
				)
			else
				warn(self.Name, "command has no implementation!")
			end

			self.Response = "No implementation."
		else -- We're on the client, so we send this off to the server to let the server see what it can do with it.
			self.Response = self.Dispatcher:Send(self.RawText, self.Data)
		end
	end

	local afterRunHook = self.Dispatcher:RunHooks("AfterRun", self)
	if afterRunHook then
		return afterRunHook
	else
		return self.Response
	end
end
