local d=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 x=setmetatable({},d)x.__index=x function x.new()local z=setmetatable(d.new(),x)z.textFocusReleasedConn=nil z.textFocusGainedConn=nil z.windowFocusReleasedConn=nil z.forwardValue=0 z.backwardValue=0 z.leftValue=0 z.rightValue=0 return z end local z=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local q=Vector3.new(0,0,0)function x.Enable(d,x)if not z.KeyboardEnabled then return false end if x==d.enabled then return true end d.forwardValue=0 d.backwardValue=0 d.leftValue=0 d.rightValue=0 d.moveVector=q d.isJumping=false if x then d:BindContextActions()d:ConnectFocusEventListeners()else d:UnbindContextActions()d:DisconnectFocusEventListeners()end d.enabled=x return true end function x.UpdateMovement(d,x)if x==Enum.UserInputState.Cancel then d.moveVector=q return end d.moveVector=Vector3.new(d.leftValue+d.rightValue,0,d.forwardValue+d.backwardValue)end local N=game:GetService("\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")function x.BindContextActions(d)N:BindAction("\109\111\118\101\070\111\114\119\097\114\100\065\099\116\105\111\110",function(x,z,q)if z==Enum.UserInputState.Begin then local d=-1 else v4=0 end d.forwardValue=v4 d:UpdateMovement(z)end,false,Enum.PlayerActions.CharacterForward)N:BindAction("\109\111\118\101\066\097\099\107\119\097\114\100\065\099\116\105\111\110",function(x,z,q)if z==Enum.UserInputState.Begin then local d=1 else v5=0 end d.backwardValue=v5 d:UpdateMovement(z)end,false,Enum.PlayerActions.CharacterBackward)N:BindAction("\109\111\118\101\076\101\102\116\065\099\116\105\111\110",function(x,z,q)if z==Enum.UserInputState.Begin then local d=-1 else v6=0 end d.leftValue=v6 d:UpdateMovement(z)end,false,Enum.PlayerActions.CharacterLeft)N:BindAction("\109\111\118\101\082\105\103\104\116\065\099\116\105\111\110",function(x,z,q)if z==Enum.UserInputState.Begin then local d=1 else v7=0 end d.rightValue=v7 d:UpdateMovement(z)end,false,Enum.PlayerActions.CharacterRight)N:BindAction("\106\117\109\112\065\099\116\105\111\110",function(x,z,q)d.isJumping=z==Enum.UserInputState.Begin end,false,Enum.PlayerActions.CharacterJump)end function x.UnbindContextActions(d)N:UnbindAction("\109\111\118\101\070\111\114\119\097\114\100\065\099\116\105\111\110")N:UnbindAction("\109\111\118\101\066\097\099\107\119\097\114\100\065\099\116\105\111\110")N:UnbindAction("\109\111\118\101\076\101\102\116\065\099\116\105\111\110")N:UnbindAction("\109\111\118\101\082\105\103\104\116\065\099\116\105\111\110")N:UnbindAction("\106\117\109\112\065\099\116\105\111\110")end function x.ConnectFocusEventListeners(d)local function x()d.moveVector=q d.forwardValue=0 d.backwardValue=0 d.leftValue=0 d.rightValue=0 d.isJumping=false end d.textFocusReleasedConn=z.TextBoxFocusReleased:Connect(x)d.textFocusGainedConn=z.TextBoxFocused:Connect(function(x)d.isJumping=false end)d.windowFocusReleasedConn=z.WindowFocused:Connect(x)end function x.DisconnectFocusEventListeners(d)if d.textFocusReleasedCon then d.textFocusReleasedCon:Disconnect()d.textFocusReleasedCon=nil end if d.textFocusGainedConn then d.textFocusGainedConn:Disconnect()d.textFocusGainedConn=nil end if d.windowFocusReleasedConn then d.windowFocusReleasedConn:Disconnect()d.windowFocusReleasedConn=nil end end return x


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

