function ControlModule.SelectComputerMovementModule(P)if not(UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled)then return nil,false end local l local r=Players.LocalPlayer.DevComputerMovementMode if r==Enum.DevComputerMovementMode.UserChoice then l=computerInputTypeToModuleMap[lastInputType]if UserGameSettings.ComputerMovementMode==Enum.ComputerMovementMode.ClickToMove and l==Keyboard then l=ClickToMove end else l=movementEnumToModuleMap[r]if not l and r~=Enum.DevComputerMovementMode.Scriptable then warn("\078\111 \099\104\097\114\097\099\116\101\114 \099\111\110\116\114\111\108 \109\111\100\117\108\101 \105\115 \097\115\115\111\099\105\097\116\101\100 \119\105\116\104 \068\101\118\067\111\109\112\117\116\101\114\077\111\118\101\109\101\110\116\077\111\100\101 ",r)end end if l then return l,true elseif r==Enum.DevComputerMovementMode.Scriptable then return nil,true else return nil,false end end
-- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable
function ControlModule:SelectComputerMovementModule()
	if not (UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled) then
		return nil, false
	end

	local computerModule
	local DevMovementMode = Players.LocalPlayer.DevComputerMovementMode

	if DevMovementMode == Enum.DevComputerMovementMode.UserChoice then
		computerModule = computerInputTypeToModuleMap[lastInputType]
		if
			UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove
			and computerModule == Keyboard
		then
			-- User has ClickToMove set in Settings, prefer ClickToMove controller for keyboard and mouse lastInputTypes
			computerModule = ClickToMove
		end
	else
		-- Developer has selected a mode that must be used.
		computerModule = movementEnumToModuleMap[DevMovementMode]

		-- computerModule is expected to be nil here only when developer has selected Scriptable
		if (not computerModule) and DevMovementMode ~= Enum.DevComputerMovementMode.Scriptable then
			warn("No character control module is associated with DevComputerMovementMode ", DevMovementMode)
		end
	end

	if computerModule then
		return computerModule, true
	elseif DevMovementMode == Enum.DevComputerMovementMode.Scriptable then
		-- Special case where nil is returned and we actually want to set self.activeController to nil for Scriptable
		return nil, true
	else
		-- This case is for when computerModule is nil because of an error and no suitable control module could
		-- be found.
		return nil, false
	end
end
