local Q=require(script.Parent:WaitForChild("\066\097\115\101\067\104\097\114\097\099\116\101\114\067\111\110\116\114\111\108\108\101\114"))local R=setmetatable({},Q)R.__index=R function R.new(Y)local n=setmetatable(Q.new(),R)n.CONTROL_ACTION_PRIORITY=Y n.textFocusReleasedConn=nil n.textFocusGainedConn=nil n.windowFocusReleasedConn=nil n.forwardValue=0 n.backwardValue=0 n.leftValue=0 n.rightValue=0 n.jumpEnabled=true return n end local Y=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local n=Vector3.new(0,0,0)function R.Enable(Q,R)if not Y.KeyboardEnabled then return false end if R==Q.enabled then return true end Q.forwardValue=0 Q.backwardValue=0 Q.leftValue=0 Q.rightValue=0 Q.moveVector=n Q.jumpRequested=false Q:UpdateJump()if R then Q:BindContextActions()Q:ConnectFocusEventListeners()else Q:UnbindContextActions()Q:DisconnectFocusEventListeners()end Q.enabled=R return true end function R.UpdateMovement(Q,R)if R==Enum.UserInputState.Cancel then Q.moveVector=n return end Q.moveVector=Vector3.new(Q.leftValue+Q.rightValue,0,Q.forwardValue+Q.backwardValue)end function R.UpdateJump(Q)Q.isJumping=Q.jumpRequested end local x=game:GetService("\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")function R.BindContextActions(Q)x:BindActionAtPriority("\109\111\118\101\070\111\114\119\097\114\100\065\099\116\105\111\110",function(R,Y,n)if Y==Enum.UserInputState.Begin then local Q=-1 else v4=0 end Q.forwardValue=v4 Q:UpdateMovement(Y)return Enum.ContextActionResult.Pass end,false,Q.CONTROL_ACTION_PRIORITY,Enum.PlayerActions.CharacterForward)x:BindActionAtPriority("\109\111\118\101\066\097\099\107\119\097\114\100\065\099\116\105\111\110",function(R,Y,n)if Y==Enum.UserInputState.Begin then local Q=1 else v5=0 end Q.backwardValue=v5 Q:UpdateMovement(Y)return Enum.ContextActionResult.Pass end,false,Q.CONTROL_ACTION_PRIORITY,Enum.PlayerActions.CharacterBackward)x:BindActionAtPriority("\109\111\118\101\076\101\102\116\065\099\116\105\111\110",function(R,Y,n)if Y==Enum.UserInputState.Begin then local Q=-1 else v6=0 end Q.leftValue=v6 Q:UpdateMovement(Y)return Enum.ContextActionResult.Pass end,false,Q.CONTROL_ACTION_PRIORITY,Enum.PlayerActions.CharacterLeft)x:BindActionAtPriority("\109\111\118\101\082\105\103\104\116\065\099\116\105\111\110",function(R,Y,n)if Y==Enum.UserInputState.Begin then local Q=1 else v7=0 end Q.rightValue=v7 Q:UpdateMovement(Y)return Enum.ContextActionResult.Pass end,false,Q.CONTROL_ACTION_PRIORITY,Enum.PlayerActions.CharacterRight)x:BindActionAtPriority("\106\117\109\112\065\099\116\105\111\110",function(R,Y,n)local x=Q.jumpEnabled and Y==Enum.UserInputState.Begin Q.jumpRequested=x Q:UpdateJump()return Enum.ContextActionResult.Pass end,false,Q.CONTROL_ACTION_PRIORITY,Enum.PlayerActions.CharacterJump)end function R.UnbindContextActions(Q)x:UnbindAction("\109\111\118\101\070\111\114\119\097\114\100\065\099\116\105\111\110")x:UnbindAction("\109\111\118\101\066\097\099\107\119\097\114\100\065\099\116\105\111\110")x:UnbindAction("\109\111\118\101\076\101\102\116\065\099\116\105\111\110")x:UnbindAction("\109\111\118\101\082\105\103\104\116\065\099\116\105\111\110")x:UnbindAction("\106\117\109\112\065\099\116\105\111\110")end function R.ConnectFocusEventListeners(Q)local function R()Q.moveVector=n Q.forwardValue=0 Q.backwardValue=0 Q.leftValue=0 Q.rightValue=0 Q.jumpRequested=false Q:UpdateJump()end Q.textFocusReleasedConn=Y.TextBoxFocusReleased:Connect(R)Q.textFocusGainedConn=Y.TextBoxFocused:Connect(function(R)Q.jumpRequested=false Q:UpdateJump()end)Q.windowFocusReleasedConn=Y.WindowFocused:Connect(R)end function R.DisconnectFocusEventListeners(Q)if Q.textFocusReleasedConn then Q.textFocusReleasedConn:Disconnect()Q.textFocusReleasedConn=nil end if Q.textFocusGainedConn then Q.textFocusGainedConn:Disconnect()Q.textFocusGainedConn=nil end if Q.windowFocusReleasedConn then Q.windowFocusReleasedConn:Disconnect()Q.windowFocusReleasedConn=nil end end return R


local v1 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v2 = setmetatable({}, v1);
v2.__index = v2;
function v2.new(p1)
	local v3 = setmetatable(v1.new(), v2);
	v3.CONTROL_ACTION_PRIORITY = p1;
	v3.textFocusReleasedConn = nil;
	v3.textFocusGainedConn = nil;
	v3.windowFocusReleasedConn = nil;
	v3.forwardValue = 0;
	v3.backwardValue = 0;
	v3.leftValue = 0;
	v3.rightValue = 0;
	v3.jumpEnabled = true;
	return v3;
end;
local l__UserInputService__1 = game:GetService("UserInputService");
local u2 = Vector3.new(0, 0, 0);
function v2.Enable(p2, p3)
	if not l__UserInputService__1.KeyboardEnabled then
		return false;
	end;
	if p3 == p2.enabled then
		return true;
	end;
	p2.forwardValue = 0;
	p2.backwardValue = 0;
	p2.leftValue = 0;
	p2.rightValue = 0;
	p2.moveVector = u2;
	p2.jumpRequested = false;
	p2:UpdateJump();
	if p3 then
		p2:BindContextActions();
		p2:ConnectFocusEventListeners();
	else
		p2:UnbindContextActions();
		p2:DisconnectFocusEventListeners();
	end;
	p2.enabled = p3;
	return true;
end;
function v2.UpdateMovement(p4, p5)
	if p5 == Enum.UserInputState.Cancel then
		p4.moveVector = u2;
		return;
	end;
	p4.moveVector = Vector3.new(p4.leftValue + p4.rightValue, 0, p4.forwardValue + p4.backwardValue);
end;
function v2.UpdateJump(p6)
	p6.isJumping = p6.jumpRequested;
end;
local l__ContextActionService__3 = game:GetService("ContextActionService");
function v2.BindContextActions(p7)
	l__ContextActionService__3:BindActionAtPriority("moveForwardAction", function(p8, p9, p10)
		if p9 == Enum.UserInputState.Begin then
			local v4 = -1;
		else
			v4 = 0;
		end;
		p7.forwardValue = v4;
		p7:UpdateMovement(p9);
		return Enum.ContextActionResult.Pass;
	end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward);
	l__ContextActionService__3:BindActionAtPriority("moveBackwardAction", function(p11, p12, p13)
		if p12 == Enum.UserInputState.Begin then
			local v5 = 1;
		else
			v5 = 0;
		end;
		p7.backwardValue = v5;
		p7:UpdateMovement(p12);
		return Enum.ContextActionResult.Pass;
	end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward);
	l__ContextActionService__3:BindActionAtPriority("moveLeftAction", function(p14, p15, p16)
		if p15 == Enum.UserInputState.Begin then
			local v6 = -1;
		else
			v6 = 0;
		end;
		p7.leftValue = v6;
		p7:UpdateMovement(p15);
		return Enum.ContextActionResult.Pass;
	end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft);
	l__ContextActionService__3:BindActionAtPriority("moveRightAction", function(p17, p18, p19)
		if p18 == Enum.UserInputState.Begin then
			local v7 = 1;
		else
			v7 = 0;
		end;
		p7.rightValue = v7;
		p7:UpdateMovement(p18);
		return Enum.ContextActionResult.Pass;
	end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight);
	l__ContextActionService__3:BindActionAtPriority("jumpAction", function(p20, p21, p22)
		local v8 = p7.jumpEnabled and p21 == Enum.UserInputState.Begin;
		p7.jumpRequested = v8;
		p7:UpdateJump();
		return Enum.ContextActionResult.Pass;
	end, false, p7.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump);
end;
function v2.UnbindContextActions(p23)
	l__ContextActionService__3:UnbindAction("moveForwardAction");
	l__ContextActionService__3:UnbindAction("moveBackwardAction");
	l__ContextActionService__3:UnbindAction("moveLeftAction");
	l__ContextActionService__3:UnbindAction("moveRightAction");
	l__ContextActionService__3:UnbindAction("jumpAction");
end;
function v2.ConnectFocusEventListeners(p24)
	local function v9()
		p24.moveVector = u2;
		p24.forwardValue = 0;
		p24.backwardValue = 0;
		p24.leftValue = 0;
		p24.rightValue = 0;
		p24.jumpRequested = false;
		p24:UpdateJump();
	end;
	p24.textFocusReleasedConn = l__UserInputService__1.TextBoxFocusReleased:Connect(v9);
	p24.textFocusGainedConn = l__UserInputService__1.TextBoxFocused:Connect(function(p25)
		p24.jumpRequested = false;
		p24:UpdateJump();
	end);
	p24.windowFocusReleasedConn = l__UserInputService__1.WindowFocused:Connect(v9);
end;
function v2.DisconnectFocusEventListeners(p26)
	if p26.textFocusReleasedConn then
		p26.textFocusReleasedConn:Disconnect();
		p26.textFocusReleasedConn = nil;
	end;
	if p26.textFocusGainedConn then
		p26.textFocusGainedConn:Disconnect();
		p26.textFocusGainedConn = nil;
	end;
	if p26.windowFocusReleasedConn then
		p26.windowFocusReleasedConn:Disconnect();
		p26.windowFocusReleasedConn = nil;
	end;
end;
return v2;
