local j={}j.__index=j local T=game:GetService("\080\108\097\121\101\114\115")local b=game:GetService("\082\117\110\083\101\114\118\105\099\101")local B=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local s=game:GetService("\087\111\114\107\115\112\097\099\101")local Y=(UserSettings()):GetService("\085\115\101\114\071\097\109\101\083\101\116\116\105\110\103\115")local U=game:GetService("\086\082\083\101\114\118\105\099\101")local Z=require(script:WaitForChild("\075\101\121\098\111\097\114\100"))local H=require(script:WaitForChild("\071\097\109\101\112\097\100"))local J=require(script:WaitForChild("\068\121\110\097\109\105\099\084\104\117\109\098\115\116\105\099\107"))local M,P=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\070\108\097\103\069\110\097\098\108\101\078\101\119\086\082\083\121\115\116\101\109")end)local G,I=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\077\097\107\101\084\104\117\109\098\115\116\105\099\107\068\121\110\097\109\105\099")end)local m=(G or I)and J or require(script:WaitForChild("\084\111\117\099\104\084\104\117\109\098\115\116\105\099\107"))local F=require(script:WaitForChild("\067\108\105\099\107\084\111\077\111\118\101\067\111\110\116\114\111\108\108\101\114"))local y=require(script:WaitForChild("\086\101\104\105\099\108\101\067\111\110\116\114\111\108\108\101\114"))local f=Enum.ContextActionPriority.Default.Value function j.new()local s=setmetatable({},j)s.controllers={}s.activeControlModule=nil s.activeController=nil s.touchJumpController=nil s.moveFunction=T.LocalPlayer.Move s.humanoid=nil s.lastInputType=Enum.UserInputType.None s.humanoidSeatedConn=nil s.vehicleController=nil s.touchControlFrame=nil s.vehicleController=y.new(f)T.LocalPlayer.CharacterAdded:Connect(function(j)s:OnCharacterAdded(j)end)T.LocalPlayer.CharacterRemoving:Connect(function(j)s:OnCharacterRemoving(j)end)if T.LocalPlayer.Character then s:OnCharacterAdded(T.LocalPlayer.Character)end b:BindToRenderStep("\067\111\110\116\114\111\108\083\099\114\105\112\116\082\101\110\100\101\114\115\116\101\112",Enum.RenderPriority.Input.Value,function(j)s:OnRenderStepped(j)end)B.LastInputTypeChanged:Connect(function(j)s:OnLastInputTypeChanged(j)end);(Y:GetPropertyChangedSignal("\084\111\117\099\104\077\111\118\101\109\101\110\116\077\111\100\101")):Connect(function()s:OnTouchMovementModeChange()end);(T.LocalPlayer:GetPropertyChangedSignal("\068\101\118\084\111\117\099\104\077\111\118\101\109\101\110\116\077\111\100\101")):Connect(function()s:OnTouchMovementModeChange()end);(Y:GetPropertyChangedSignal("\067\111\109\112\117\116\101\114\077\111\118\101\109\101\110\116\077\111\100\101")):Connect(function()s:OnComputerMovementModeChange()end);(T.LocalPlayer:GetPropertyChangedSignal("\068\101\118\067\111\109\112\117\116\101\114\077\111\118\101\109\101\110\116\077\111\100\101")):Connect(function()s:OnComputerMovementModeChange()end)s.playerGui=nil s.touchGui=nil s.playerGuiAddedConn=nil;(B:GetPropertyChangedSignal("\077\111\100\097\108\069\110\097\098\108\101\100")):Connect(function()s:UpdateTouchGuiVisibility()end)if not B.TouchEnabled then s:OnLastInputTypeChanged(B:GetLastInputType())return s end s.playerGui=T.LocalPlayer:FindFirstChildOfClass("\080\108\097\121\101\114\071\117\105")if not s.playerGui then s.playerGuiAddedConn=T.LocalPlayer.ChildAdded:Connect(function(j)if j:IsA("\080\108\097\121\101\114\071\117\105")then s.playerGui=j s:CreateTouchGuiContainer()s.playerGuiAddedConn:Disconnect()s.playerGuiAddedConn=nil s:OnLastInputTypeChanged(B:GetLastInputType())end end)return s end s:CreateTouchGuiContainer()s:OnLastInputTypeChanged(B:GetLastInputType())return s end function j.GetMoveVector(j)if not j.activeController then return Vector3.new(0,0,0)end return j.activeController:GetMoveVector()end function j.GetActiveController(j)return j.activeController end function j.EnableActiveControlModule(j)if j.activeControlModule==F then j.activeController:Enable(true,T.LocalPlayer.DevComputerMovementMode==Enum.DevComputerMovementMode.UserChoice,j.touchJumpController)return end if not j.touchControlFrame then j.activeController:Enable(true)return end j.activeController:Enable(true,j.touchControlFrame)end function j.Enable(j,T)if not j.activeController then return end if T==nil then T=true end if T then j:EnableActiveControlModule()return end j:Disable()end function j.Disable(j)if j.activeController then j.activeController:Enable(false)if j.moveFunction then j.moveFunction(T.LocalPlayer,Vector3.new(0,0,0),true)end end end local i={[Enum.UserInputType.Keyboard]=Z;[Enum.UserInputType.MouseButton1]=Z,[Enum.UserInputType.MouseButton2]=Z,[Enum.UserInputType.MouseButton3]=Z,[Enum.UserInputType.MouseWheel]=Z,[Enum.UserInputType.MouseMovement]=Z,[Enum.UserInputType.Gamepad1]=H,[Enum.UserInputType.Gamepad2]=H,[Enum.UserInputType.Gamepad3]=H,[Enum.UserInputType.Gamepad4]=H}local t=nil local X={[Enum.TouchMovementMode.DPad]=J,[Enum.DevTouchMovementMode.DPad]=J,[Enum.TouchMovementMode.Thumbpad]=J,[Enum.DevTouchMovementMode.Thumbpad]=J;[Enum.TouchMovementMode.Thumbstick]=m,[Enum.DevTouchMovementMode.Thumbstick]=m;[Enum.TouchMovementMode.DynamicThumbstick]=J;[Enum.DevTouchMovementMode.DynamicThumbstick]=J,[Enum.TouchMovementMode.ClickToMove]=F;[Enum.DevTouchMovementMode.ClickToMove]=F;[Enum.TouchMovementMode.Default]=J;[Enum.ComputerMovementMode.Default]=Z;[Enum.ComputerMovementMode.KeyboardMouse]=Z;[Enum.DevComputerMovementMode.KeyboardMouse]=Z;[Enum.DevComputerMovementMode.Scriptable]=nil,[Enum.ComputerMovementMode.ClickToMove]=F;[Enum.DevComputerMovementMode.ClickToMove]=F}function j.SelectComputerMovementModule(j)if not B.KeyboardEnabled and not B.GamepadEnabled then return nil,false end local b=T.LocalPlayer.DevComputerMovementMode if b==Enum.DevComputerMovementMode.UserChoice then local j=i[t]if Y.ComputerMovementMode==Enum.ComputerMovementMode.ClickToMove and j==Z then j=F end else v19=X[b]if not v19 and b~=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 ",b)end end if v19 then return v19,true end if b==Enum.DevComputerMovementMode.Scriptable then return nil,true end return nil,false end function j.SelectTouchModule(j)if not B.TouchEnabled then return nil,false end local b=T.LocalPlayer.DevTouchMovementMode if b==Enum.DevTouchMovementMode.UserChoice then local j=X[Y.TouchMovementMode]else if b==Enum.DevTouchMovementMode.Scriptable then return nil,true end v21=X[b]end return v21,true end local l=M or P local function q(j,T)local b=s.CurrentCamera if not b then return T end if j:GetState()==Enum.HumanoidStateType.Swimming then return b.CFrame:VectorToWorldSpace(T)end local B=b.CFrame if U.VREnabled and(l and(j.RootPart and(j.RootPart.CFrame.Position-B.Position).Magnitude<3))then B=B*U:GetUserCFrame(Enum.UserCFrame.Head)end local Y,Z,H,J,M,P,G,I,m,F,y,f=B:GetComponents()if m<1 and m>-1 then local j=f local T=P else v36=J v37=-M*math.sign(m)end local i=math.sqrt(v36*v36+v37*v37)return Vector3.new((v36*T.x+v37*T.z)/i,0,(v36*T.z-v37*T.x)/i)end function j.OnRenderStepped(j,b)if j.activeController and(j.activeController.enabled and j.humanoid)then j.activeController:OnRenderStepped(b)local B=j.activeController:GetMoveVector()local s=j.activeController:IsMoveVectorCameraRelative()local Y=j:GetClickToMoveController()if j.activeController~=Y then if B.magnitude>0 then Y:CleanupPath()else Y:OnRenderStepped(b)B=Y:GetMoveVector()s=Y:IsMoveVectorCameraRelative()end end if j.vehicleController then local T,b=j.vehicleController:Update(B,s,j.activeControlModule==H)B=T end if s then B=q(j.humanoid,B)end j.moveFunction(T.LocalPlayer,B,false)j.humanoid.Jump=j.activeController:GetIsJumping()or j.touchJumpController and j.touchJumpController:GetIsJumping()end end function j.OnHumanoidSeated(j,T,b)if T then if b and b:IsA("\086\101\104\105\099\108\101\083\101\097\116")then if not j.vehicleController then j.vehicleController=j.vehicleController.new(f)end j.vehicleController:Enable(true,b)return end elseif j.vehicleController then j.vehicleController:Enable(false,b)end end function j.OnCharacterAdded(j,T)j.humanoid=T:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")while not j.humanoid do T.ChildAdded:wait()j.humanoid=T:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")end j:UpdateTouchGuiVisibility()if j.humanoidSeatedConn then j.humanoidSeatedConn:Disconnect()j.humanoidSeatedConn=nil end j.humanoidSeatedConn=j.humanoid.Seated:Connect(function(T,b)j:OnHumanoidSeated(T,b)end)end function j.OnCharacterRemoving(j,T)j.humanoid=nil j:UpdateTouchGuiVisibility()end function j.UpdateTouchGuiVisibility(j)if j.touchGui then j.touchGui.Enabled=not(not j.humanoid)and not B.ModalEnabled end end local A=require(script:WaitForChild("\084\111\117\099\104\074\117\109\112"))function j.SwitchToController(j,T)if not T then if j.activeController then j.activeController:Enable(false)end j.activeController=nil j.activeControlModule=nil return end if not j.controllers[T]then j.controllers[T]=T.new(f)end if j.activeController~=j.controllers[T]then if j.activeController then j.activeController:Enable(false)end j.activeController=j.controllers[T]j.activeControlModule=T if j.touchControlFrame and(j.activeControlModule==F or j.activeControlModule==m or j.activeControlModule==J)then if not j.controllers[A]then j.controllers[A]=A.new()end j.touchJumpController=j.controllers[A]j.touchJumpController:Enable(true,j.touchControlFrame)elseif j.touchJumpController then j.touchJumpController:Enable(false)end j:EnableActiveControlModule()end end function j.OnLastInputTypeChanged(j,T)if t==T then warn("\076\097\115\116\073\110\112\117\116\084\121\112\101 \067\104\097\110\103\101 \108\105\115\116\101\110\101\114 \099\097\108\108\101\100 \119\105\116\104 \099\117\114\114\101\110\116 \116\121\112\101\046")end t=T if t==Enum.UserInputType.Touch then local T,b=j:SelectTouchModule()if b then while not j.touchControlFrame do wait()end j:SwitchToController(T)end elseif i[t]~=nil then local T=j:SelectComputerMovementModule()if T then j:SwitchToController(T)end end j:UpdateTouchGuiVisibility()end function j.OnComputerMovementModeChange(j)local T,b=j:SelectComputerMovementModule()if b then j:SwitchToController(T)end end function j.OnTouchMovementModeChange(j)local T,b=j:SelectTouchModule()if b then while not j.touchControlFrame do wait()end j:SwitchToController(T)end end function j.CreateTouchGuiContainer(j)if j.touchGui then j.touchGui:Destroy()end j.touchGui=Instance.new("\083\099\114\101\101\110\071\117\105")j.touchGui.Name="\084\111\117\099\104\071\117\105"j.touchGui.ResetOnSpawn=false j.touchGui.ZIndexBehavior=Enum.ZIndexBehavior.Sibling j:UpdateTouchGuiVisibility()j.touchControlFrame=Instance.new("\070\114\097\109\101")j.touchControlFrame.Name="\084\111\117\099\104\067\111\110\116\114\111\108\070\114\097\109\101"j.touchControlFrame.Size=UDim2.new(1,0,1,0)j.touchControlFrame.BackgroundTransparency=1 j.touchControlFrame.Parent=j.touchGui j.touchGui.Parent=j.playerGui end function j.GetClickToMoveController(j)if not j.controllers[F]then j.controllers[F]=F.new(f)end return j.controllers[F]end return j.new()


local v1 = {};
v1.__index = v1;
local l__Players__2 = game:GetService("Players");
local l__RunService__3 = game:GetService("RunService");
local l__UserInputService__4 = game:GetService("UserInputService");
local l__Workspace__5 = game:GetService("Workspace");
local l__UserGameSettings__6 = UserSettings():GetService("UserGameSettings");
local l__VRService__7 = game:GetService("VRService");
local v8 = require(script:WaitForChild("Keyboard"));
local v9 = require(script:WaitForChild("Gamepad"));
local v10 = require(script:WaitForChild("DynamicThumbstick"));
local v11, v12 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserFlagEnableNewVRSystem");
end);
local v13, v14 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserMakeThumbstickDynamic");
end);
local v15 = (v13 or v14) and v10 or require(script:WaitForChild("TouchThumbstick"));
local v16 = require(script:WaitForChild("ClickToMoveController"));
local u1 = require(script:WaitForChild("VehicleController"));
local l__Value__2 = Enum.ContextActionPriority.Default.Value;
function v1.new()
	local v17 = setmetatable({}, v1);
	v17.controllers = {};
	v17.activeControlModule = nil;
	v17.activeController = nil;
	v17.touchJumpController = nil;
	v17.moveFunction = l__Players__2.LocalPlayer.Move;
	v17.humanoid = nil;
	v17.lastInputType = Enum.UserInputType.None;
	v17.humanoidSeatedConn = nil;
	v17.vehicleController = nil;
	v17.touchControlFrame = nil;
	v17.vehicleController = u1.new(l__Value__2);
	l__Players__2.LocalPlayer.CharacterAdded:Connect(function(p1)
		v17:OnCharacterAdded(p1);
	end);
	l__Players__2.LocalPlayer.CharacterRemoving:Connect(function(p2)
		v17:OnCharacterRemoving(p2);
	end);
	if l__Players__2.LocalPlayer.Character then
		v17:OnCharacterAdded(l__Players__2.LocalPlayer.Character);
	end;
	l__RunService__3:BindToRenderStep("ControlScriptRenderstep", Enum.RenderPriority.Input.Value, function(p3)
		v17:OnRenderStepped(p3);
	end);
	l__UserInputService__4.LastInputTypeChanged:Connect(function(p4)
		v17:OnLastInputTypeChanged(p4);
	end);
	l__UserGameSettings__6:GetPropertyChangedSignal("TouchMovementMode"):Connect(function()
		v17:OnTouchMovementModeChange();
	end);
	l__Players__2.LocalPlayer:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function()
		v17:OnTouchMovementModeChange();
	end);
	l__UserGameSettings__6:GetPropertyChangedSignal("ComputerMovementMode"):Connect(function()
		v17:OnComputerMovementModeChange();
	end);
	l__Players__2.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
		v17:OnComputerMovementModeChange();
	end);
	v17.playerGui = nil;
	v17.touchGui = nil;
	v17.playerGuiAddedConn = nil;
	l__UserInputService__4:GetPropertyChangedSignal("ModalEnabled"):Connect(function()
		v17:UpdateTouchGuiVisibility();
	end);
	if not l__UserInputService__4.TouchEnabled then
		v17:OnLastInputTypeChanged(l__UserInputService__4:GetLastInputType());
		return v17;
	end;
	v17.playerGui = l__Players__2.LocalPlayer:FindFirstChildOfClass("PlayerGui");
	if not v17.playerGui then
		v17.playerGuiAddedConn = l__Players__2.LocalPlayer.ChildAdded:Connect(function(p5)
			if p5:IsA("PlayerGui") then
				v17.playerGui = p5;
				v17:CreateTouchGuiContainer();
				v17.playerGuiAddedConn:Disconnect();
				v17.playerGuiAddedConn = nil;
				v17:OnLastInputTypeChanged(l__UserInputService__4:GetLastInputType());
			end;
		end);
		return v17;
	end;
	v17:CreateTouchGuiContainer();
	v17:OnLastInputTypeChanged(l__UserInputService__4:GetLastInputType());
	return v17;
end;
function v1.GetMoveVector(p6)
	if not p6.activeController then
		return Vector3.new(0, 0, 0);
	end;
	return p6.activeController:GetMoveVector();
end;
function v1.GetActiveController(p7)
	return p7.activeController;
end;
function v1.EnableActiveControlModule(p8)
	if p8.activeControlModule == v16 then
		p8.activeController:Enable(true, l__Players__2.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice, p8.touchJumpController);
		return;
	end;
	if not p8.touchControlFrame then
		p8.activeController:Enable(true);
		return;
	end;
	p8.activeController:Enable(true, p8.touchControlFrame);
end;
function v1.Enable(p9, p10)
	if not p9.activeController then
		return;
	end;
	if p10 == nil then
		p10 = true;
	end;
	if p10 then
		p9:EnableActiveControlModule();
		return;
	end;
	p9:Disable();
end;
function v1.Disable(p11)
	if p11.activeController then
		p11.activeController:Enable(false);
		if p11.moveFunction then
			p11.moveFunction(l__Players__2.LocalPlayer, Vector3.new(0, 0, 0), true);
		end;
	end;
end;
local u3 = {
	[Enum.UserInputType.Keyboard] = v8, 
	[Enum.UserInputType.MouseButton1] = v8, 
	[Enum.UserInputType.MouseButton2] = v8, 
	[Enum.UserInputType.MouseButton3] = v8, 
	[Enum.UserInputType.MouseWheel] = v8, 
	[Enum.UserInputType.MouseMovement] = v8, 
	[Enum.UserInputType.Gamepad1] = v9, 
	[Enum.UserInputType.Gamepad2] = v9, 
	[Enum.UserInputType.Gamepad3] = v9, 
	[Enum.UserInputType.Gamepad4] = v9
};
local u4 = nil;
local u5 = {
	[Enum.TouchMovementMode.DPad] = v10, 
	[Enum.DevTouchMovementMode.DPad] = v10, 
	[Enum.TouchMovementMode.Thumbpad] = v10, 
	[Enum.DevTouchMovementMode.Thumbpad] = v10, 
	[Enum.TouchMovementMode.Thumbstick] = v15, 
	[Enum.DevTouchMovementMode.Thumbstick] = v15, 
	[Enum.TouchMovementMode.DynamicThumbstick] = v10, 
	[Enum.DevTouchMovementMode.DynamicThumbstick] = v10, 
	[Enum.TouchMovementMode.ClickToMove] = v16, 
	[Enum.DevTouchMovementMode.ClickToMove] = v16, 
	[Enum.TouchMovementMode.Default] = v10, 
	[Enum.ComputerMovementMode.Default] = v8, 
	[Enum.ComputerMovementMode.KeyboardMouse] = v8, 
	[Enum.DevComputerMovementMode.KeyboardMouse] = v8, 
	[Enum.DevComputerMovementMode.Scriptable] = nil, 
	[Enum.ComputerMovementMode.ClickToMove] = v16, 
	[Enum.DevComputerMovementMode.ClickToMove] = v16
};
function v1.SelectComputerMovementModule(p12)
	if not l__UserInputService__4.KeyboardEnabled and not l__UserInputService__4.GamepadEnabled then
		return nil, false;
	end;
	local l__DevComputerMovementMode__18 = l__Players__2.LocalPlayer.DevComputerMovementMode;
	if l__DevComputerMovementMode__18 == Enum.DevComputerMovementMode.UserChoice then
		local v19 = u3[u4];
		if l__UserGameSettings__6.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove and v19 == v8 then
			v19 = v16;
		end;
	else
		v19 = u5[l__DevComputerMovementMode__18];
		if not v19 and l__DevComputerMovementMode__18 ~= Enum.DevComputerMovementMode.Scriptable then
			warn("No character control module is associated with DevComputerMovementMode ", l__DevComputerMovementMode__18);
		end;
	end;
	if v19 then
		return v19, true;
	end;
	if l__DevComputerMovementMode__18 == Enum.DevComputerMovementMode.Scriptable then
		return nil, true;
	end;
	return nil, false;
end;
function v1.SelectTouchModule(p13)
	if not l__UserInputService__4.TouchEnabled then
		return nil, false;
	end;
	local l__DevTouchMovementMode__20 = l__Players__2.LocalPlayer.DevTouchMovementMode;
	if l__DevTouchMovementMode__20 == Enum.DevTouchMovementMode.UserChoice then
		local v21 = u5[l__UserGameSettings__6.TouchMovementMode];
	else
		if l__DevTouchMovementMode__20 == Enum.DevTouchMovementMode.Scriptable then
			return nil, true;
		end;
		v21 = u5[l__DevTouchMovementMode__20];
	end;
	return v21, true;
end;
local u6 = v11 or v12;
local function u7(p14, p15)
	local l__CurrentCamera__22 = l__Workspace__5.CurrentCamera;
	if not l__CurrentCamera__22 then
		return p15;
	end;
	if p14:GetState() == Enum.HumanoidStateType.Swimming then
		return l__CurrentCamera__22.CFrame:VectorToWorldSpace(p15);
	end;
	local v23 = l__CurrentCamera__22.CFrame;
	if l__VRService__7.VREnabled and u6 and p14.RootPart and (p14.RootPart.CFrame.Position - v23.Position).Magnitude < 3 then
		v23 = v23 * l__VRService__7:GetUserCFrame(Enum.UserCFrame.Head);
	end;
	local v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35 = v23:GetComponents();
	if v32 < 1 and v32 > -1 then
		local v36 = v35;
		local v37 = v29;
	else
		v36 = v27;
		v37 = -v28 * math.sign(v32);
	end;
	local v38 = math.sqrt(v36 * v36 + v37 * v37);
	return Vector3.new((v36 * p15.x + v37 * p15.z) / v38, 0, (v36 * p15.z - v37 * p15.x) / v38);
end;
function v1.OnRenderStepped(p16, p17)
	if p16.activeController and p16.activeController.enabled and p16.humanoid then
		p16.activeController:OnRenderStepped(p17);
		local v39 = p16.activeController:GetMoveVector();
		local v40 = p16.activeController:IsMoveVectorCameraRelative();
		local v41 = p16:GetClickToMoveController();
		if p16.activeController ~= v41 then
			if v39.magnitude > 0 then
				v41:CleanupPath();
			else
				v41:OnRenderStepped(p17);
				v39 = v41:GetMoveVector();
				v40 = v41:IsMoveVectorCameraRelative();
			end;
		end;
		if p16.vehicleController then
			local v42, v43 = p16.vehicleController:Update(v39, v40, p16.activeControlModule == v9);
			v39 = v42;
		end;
		if v40 then
			v39 = u7(p16.humanoid, v39);
		end;
		p16.moveFunction(l__Players__2.LocalPlayer, v39, false);
		p16.humanoid.Jump = p16.activeController:GetIsJumping() or p16.touchJumpController and p16.touchJumpController:GetIsJumping();
	end;
end;
function v1.OnHumanoidSeated(p18, p19, p20)
	if p19 then
		if p20 and p20:IsA("VehicleSeat") then
			if not p18.vehicleController then
				p18.vehicleController = p18.vehicleController.new(l__Value__2);
			end;
			p18.vehicleController:Enable(true, p20);
			return;
		end;
	elseif p18.vehicleController then
		p18.vehicleController:Enable(false, p20);
	end;
end;
function v1.OnCharacterAdded(p21, p22)
	p21.humanoid = p22:FindFirstChildOfClass("Humanoid");
	while not p21.humanoid do
		p22.ChildAdded:wait();
		p21.humanoid = p22:FindFirstChildOfClass("Humanoid");	
	end;
	p21:UpdateTouchGuiVisibility();
	if p21.humanoidSeatedConn then
		p21.humanoidSeatedConn:Disconnect();
		p21.humanoidSeatedConn = nil;
	end;
	p21.humanoidSeatedConn = p21.humanoid.Seated:Connect(function(p23, p24)
		p21:OnHumanoidSeated(p23, p24);
	end);
end;
function v1.OnCharacterRemoving(p25, p26)
	p25.humanoid = nil;
	p25:UpdateTouchGuiVisibility();
end;
function v1.UpdateTouchGuiVisibility(p27)
	if p27.touchGui then
		p27.touchGui.Enabled = not (not p27.humanoid) and not l__UserInputService__4.ModalEnabled;
	end;
end;
local u8 = require(script:WaitForChild("TouchJump"));
function v1.SwitchToController(p28, p29)
	if not p29 then
		if p28.activeController then
			p28.activeController:Enable(false);
		end;
		p28.activeController = nil;
		p28.activeControlModule = nil;
		return;
	end;
	if not p28.controllers[p29] then
		p28.controllers[p29] = p29.new(l__Value__2);
	end;
	if p28.activeController ~= p28.controllers[p29] then
		if p28.activeController then
			p28.activeController:Enable(false);
		end;
		p28.activeController = p28.controllers[p29];
		p28.activeControlModule = p29;
		if p28.touchControlFrame and (p28.activeControlModule == v16 or p28.activeControlModule == v15 or p28.activeControlModule == v10) then
			if not p28.controllers[u8] then
				p28.controllers[u8] = u8.new();
			end;
			p28.touchJumpController = p28.controllers[u8];
			p28.touchJumpController:Enable(true, p28.touchControlFrame);
		elseif p28.touchJumpController then
			p28.touchJumpController:Enable(false);
		end;
		p28:EnableActiveControlModule();
	end;
end;
function v1.OnLastInputTypeChanged(p30, p31)
	if u4 == p31 then
		warn("LastInputType Change listener called with current type.");
	end;
	u4 = p31;
	if u4 == Enum.UserInputType.Touch then
		local v44, v45 = p30:SelectTouchModule();
		if v45 then
			while not p30.touchControlFrame do
				wait();			
			end;
			p30:SwitchToController(v44);
		end;
	elseif u3[u4] ~= nil then
		local v46 = p30:SelectComputerMovementModule();
		if v46 then
			p30:SwitchToController(v46);
		end;
	end;
	p30:UpdateTouchGuiVisibility();
end;
function v1.OnComputerMovementModeChange(p32)
	local v47, v48 = p32:SelectComputerMovementModule();
	if v48 then
		p32:SwitchToController(v47);
	end;
end;
function v1.OnTouchMovementModeChange(p33)
	local v49, v50 = p33:SelectTouchModule();
	if v50 then
		while not p33.touchControlFrame do
			wait();		
		end;
		p33:SwitchToController(v49);
	end;
end;
function v1.CreateTouchGuiContainer(p34)
	if p34.touchGui then
		p34.touchGui:Destroy();
	end;
	p34.touchGui = Instance.new("ScreenGui");
	p34.touchGui.Name = "TouchGui";
	p34.touchGui.ResetOnSpawn = false;
	p34.touchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
	p34:UpdateTouchGuiVisibility();
	p34.touchControlFrame = Instance.new("Frame");
	p34.touchControlFrame.Name = "TouchControlFrame";
	p34.touchControlFrame.Size = UDim2.new(1, 0, 1, 0);
	p34.touchControlFrame.BackgroundTransparency = 1;
	p34.touchControlFrame.Parent = p34.touchGui;
	p34.touchGui.Parent = p34.playerGui;
end;
function v1.GetClickToMoveController(p35)
	if not p35.controllers[v16] then
		p35.controllers[v16] = v16.new(l__Value__2);
	end;
	return p35.controllers[v16];
end;
return v1.new();
