local A={.11,.3;.4,.5,.6,.7,.75}local L=game:GetService("\080\108\097\121\101\114\115")local D=game:GetService("\071\117\105\083\101\114\118\105\099\101")local T=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local h=game:GetService("\082\117\110\083\101\114\118\105\099\101")local R=L.LocalPlayer if not R then(L:GetPropertyChangedSignal("\076\111\099\097\108\080\108\097\121\101\114")):Wait()R=L.LocalPlayer end local E=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 S=setmetatable({},E)S.__index=S function S.new()local A=setmetatable(E.new(),S)A.moveTouchObject=nil A.moveTouchLockedIn=false A.moveTouchFirstChanged=false A.moveTouchStartPosition=nil A.startImage=nil A.endImage=nil A.middleImages={}A.startImageFadeTween=nil A.endImageFadeTween=nil A.middleImageFadeTweens={}A.isFirstTouch=true A.thumbstickFrame=nil A.onRenderSteppedConn=nil A.fadeInAndOutBalance=.5 A.fadeInAndOutHalfDuration=.3 A.hasFadedBackgroundInPortrait=false A.hasFadedBackgroundInLandscape=false A.tweenInAlphaStart=nil A.tweenOutAlphaStart=nil return A end function S.GetIsJumping(A)A.isJumping=false return A.isJumping end local U=game:GetService("\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")function S.Enable(A,L,D)if L==nil then return false end if L then local A=true else v10=false end L=v10 if A.enabled==L then return true end if L then if not A.thumbstickFrame then A:Create(D)end A:BindContextActions()else U:UnbindAction("\068\121\110\097\109\105\099\084\104\117\109\098\115\116\105\099\107\065\099\116\105\111\110")A:OnInputEnded()end A.enabled=L A.thumbstickFrame.Visible=L return nil end local m=Vector3.new(0,0,0)function S.OnInputEnded(A)A.moveTouchObject=nil A.moveVector=m A:FadeThumbstick(false)end local V=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local b=TweenInfo.new(.15,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut)function S.FadeThumbstick(L,D)if not D and L.moveTouchObject then return end if L.isFirstTouch then return end if L.startImageFadeTween then L.startImageFadeTween:Cancel()end if L.endImageFadeTween then L.endImageFadeTween:Cancel()end for A=1,#L.middleImages,1 do if L.middleImageFadeTweens[A]then L.middleImageFadeTweens[A]:Cancel()end end if not D then L.startImageFadeTween=V:Create(L.startImage,b,{ImageTransparency=1})L.startImageFadeTween:Play()L.endImageFadeTween=V:Create(L.endImage,b,{ImageTransparency=1})L.endImageFadeTween:Play()for A=1,#L.middleImages,1 do L.middleImageFadeTweens[A]=V:Create(L.middleImages[A],b,{ImageTransparency=1})L.middleImageFadeTweens[A]:Play()end return end L.startImageFadeTween=V:Create(L.startImage,b,{ImageTransparency=0})L.startImageFadeTween:Play()L.endImageFadeTween=V:Create(L.endImage,b,{ImageTransparency=.2})L.endImageFadeTween:Play()for D=1,#L.middleImages,1 do L.middleImageFadeTweens[D]=V:Create(L.middleImages[D],b,{ImageTransparency=A[D]})L.middleImageFadeTweens[D]:Play()end end function S.FadeThumbstickFrame(A,L,D)A.fadeInAndOutHalfDuration=L*.5 A.fadeInAndOutBalance=D A.tweenInAlphaStart=tick()end function S.InputInFrame(A,L)local D=A.thumbstickFrame.AbsolutePosition local T=D+A.thumbstickFrame.AbsoluteSize local h=L.Position if D.X<=h.X and(D.Y<=h.Y and(h.X<=T.X and h.Y<=T.Y))then return true end return false end function S.DoFadeInBackground(A)local L=R:FindFirstChildOfClass("\080\108\097\121\101\114\071\117\105")local D=false if L then if L.CurrentScreenOrientation==Enum.ScreenOrientation.LandscapeLeft or L.CurrentScreenOrientation==Enum.ScreenOrientation.LandscapeRight then D=A.hasFadedBackgroundInLandscape A.hasFadedBackgroundInLandscape=true elseif L.CurrentScreenOrientation==Enum.ScreenOrientation.Portrait then D=A.hasFadedBackgroundInPortrait A.hasFadedBackgroundInPortrait=true end end if not D then A.fadeInAndOutHalfDuration=.3 A.fadeInAndOutBalance=.5 A.tweenInAlphaStart=tick()end end function S.DoMove(A,L)if L.Magnitude<A.radiusOfDeadZone then local A=m else local D=L.Unit*(1-math.max(0,(A.radiusOfMaxSpeed-L.Magnitude)/A.radiusOfMaxSpeed))v19=Vector3.new(D.X,0,D.Y)end A.moveVector=v19 end local r=#A function S.LayoutMiddleImages(A,L,D)local T=A.thumbstickSize/2+A.middleSize local h=D-L local R=(h.Magnitude-A.thumbstickRingSize/2)-A.middleSize local E=h.Unit local S=A.middleSpacing if A.middleSpacing*r<R then S=R/r end for L=1,r,1 do local h=nil h=A.middleImages[L]local U=T+S*(L-1)if T+S*(L-2)<R then local L=D-E*U local T=math.clamp(1-(U-R)/S,0,1)h.Visible=true h.Position=UDim2.new(0,L.X,0,L.Y)h.Size=UDim2.new(0,A.middleSize*T,0,A.middleSize*T)else h.Visible=false end end end function S.MoveStick(A,L)local D=Vector2.new(A.moveTouchStartPosition.X,A.moveTouchStartPosition.Y)-A.thumbstickFrame.AbsolutePosition local T=Vector2.new(L.X,L.Y)-A.thumbstickFrame.AbsolutePosition A.endImage.Position=UDim2.new(0,T.X,0,T.Y)A:LayoutMiddleImages(D,T)end local j=Enum.ContextActionPriority.High.Value function S.BindContextActions(A)local function L(L)if A.moveTouchObject then return Enum.ContextActionResult.Pass end if not A:InputInFrame(L)then return Enum.ContextActionResult.Pass end if A.isFirstTouch then A.isFirstTouch=false local L=TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0);(V:Create(A.startImage,L,{Size=UDim2.new(0,0,0,0)})):Play();(V:Create(A.endImage,L,{Size=UDim2.new(0,A.thumbstickSize,0,A.thumbstickSize);ImageColor3=Color3.new(0,0,0)})):Play()end A.moveTouchLockedIn=false A.moveTouchObject=L A.moveTouchStartPosition=L.Position A.moveTouchFirstChanged=true A:DoFadeInBackground()return Enum.ContextActionResult.Pass end local function D(L)if L~=A.moveTouchObject then return Enum.ContextActionResult.Pass end if A.moveTouchFirstChanged then A.moveTouchFirstChanged=false local D=Vector2.new(L.Position.X-A.thumbstickFrame.AbsolutePosition.X,L.Position.Y-A.thumbstickFrame.AbsolutePosition.Y)A.startImage.Visible=true A.startImage.Position=UDim2.new(0,D.X,0,D.Y)A.endImage.Visible=true A.endImage.Position=A.startImage.Position A:FadeThumbstick(true)A:MoveStick(L.Position)end A.moveTouchLockedIn=true local D=Vector2.new(L.Position.X-A.moveTouchStartPosition.X,L.Position.Y-A.moveTouchStartPosition.Y)if math.abs(D.X)>0 or math.abs(D.Y)>0 then A:DoMove(D)A:MoveStick(L.Position)end return Enum.ContextActionResult.Sink end U:BindActionAtPriority("\068\121\110\097\109\105\099\084\104\117\109\098\115\116\105\099\107\065\099\116\105\111\110",function(T,h,R)if h==Enum.UserInputState.Begin then return L(R)end if h==Enum.UserInputState.Change then return D(R)end if h~=Enum.UserInputState.End then if h==Enum.UserInputState.Cancel then A:OnInputEnded()end return end if R==A.moveTouchObject then A:OnInputEnded()if A.moveTouchLockedIn then return Enum.ContextActionResult.Sink end end return Enum.ContextActionResult.Pass end,false,j,Enum.UserInputType.Touch)end function S.Create(L,E)if L.thumbstickFrame then L.thumbstickFrame:Destroy()L.thumbstickFrame=nil if L.onRenderSteppedConn then L.onRenderSteppedConn:Disconnect()L.onRenderSteppedConn=nil end end L.thumbstickSize=45 L.thumbstickRingSize=20 L.middleSize=10 L.middleSpacing=L.middleSize+4 L.radiusOfDeadZone=2 L.radiusOfMaxSpeed=20 local S=E.AbsoluteSize if math.min(S.X,S.Y)>500 then L.thumbstickSize=L.thumbstickSize*2 L.thumbstickRingSize=L.thumbstickRingSize*2 L.middleSize=L.middleSize*2 L.middleSpacing=L.middleSpacing*2 L.radiusOfDeadZone=L.radiusOfDeadZone*2 L.radiusOfMaxSpeed=L.radiusOfMaxSpeed*2 end local function U(A)if A then L.thumbstickFrame.Size=UDim2.new(1,0,.4,0)L.thumbstickFrame.Position=UDim2.new(0,0,.6,0)return end L.thumbstickFrame.Size=UDim2.new(.4,0,.66666666666667,0)L.thumbstickFrame.Position=UDim2.new(0,0,.33333333333333,0)end L.thumbstickFrame=Instance.new("\070\114\097\109\101")L.thumbstickFrame.BorderSizePixel=0 L.thumbstickFrame.Name="\068\121\110\097\109\105\099\084\104\117\109\098\115\116\105\099\107\070\114\097\109\101"L.thumbstickFrame.Visible=false L.thumbstickFrame.BackgroundTransparency=1 L.thumbstickFrame.BackgroundColor3=Color3.fromRGB(0,0,0)L.thumbstickFrame.Active=false U(false)L.startImage=Instance.new("\073\109\097\103\101\076\097\098\101\108")L.startImage.Name="\084\104\117\109\098\115\116\105\099\107\083\116\097\114\116"L.startImage.Visible=true L.startImage.BackgroundTransparency=1 L.startImage.Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\073\110\112\117\116\047\084\111\117\099\104\067\111\110\116\114\111\108\115\083\104\101\101\116\086\050\046\112\110\103"L.startImage.ImageRectOffset=Vector2.new(1,1)L.startImage.ImageRectSize=Vector2.new(144,144)L.startImage.ImageColor3=Color3.new(0,0,0)L.startImage.AnchorPoint=Vector2.new(.5,.5)L.startImage.Position=UDim2.new(0,L.thumbstickRingSize*3.3,1,-L.thumbstickRingSize*2.8)L.startImage.Size=UDim2.new(0,L.thumbstickRingSize*3.7,0,L.thumbstickRingSize*3.7)L.startImage.ZIndex=10 L.startImage.Parent=L.thumbstickFrame L.endImage=Instance.new("\073\109\097\103\101\076\097\098\101\108")L.endImage.Name="\084\104\117\109\098\115\116\105\099\107\069\110\100"L.endImage.Visible=true L.endImage.BackgroundTransparency=1 L.endImage.Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\073\110\112\117\116\047\084\111\117\099\104\067\111\110\116\114\111\108\115\083\104\101\101\116\086\050\046\112\110\103"L.endImage.ImageRectOffset=Vector2.new(1,1)L.endImage.ImageRectSize=Vector2.new(144,144)L.endImage.AnchorPoint=Vector2.new(.5,.5)L.endImage.Position=L.startImage.Position L.endImage.Size=UDim2.new(0,L.thumbstickSize*.8,0,L.thumbstickSize*.8)L.endImage.ZIndex=10 L.endImage.Parent=L.thumbstickFrame for D=1,r,1 do L.middleImages[D]=Instance.new("\073\109\097\103\101\076\097\098\101\108")L.middleImages[D].Name="\084\104\117\109\098\115\116\105\099\107\077\105\100\100\108\101"L.middleImages[D].Visible=false L.middleImages[D].BackgroundTransparency=1 L.middleImages[D].Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\073\110\112\117\116\047\084\111\117\099\104\067\111\110\116\114\111\108\115\083\104\101\101\116\086\050\046\112\110\103"L.middleImages[D].ImageRectOffset=Vector2.new(1,1)L.middleImages[D].ImageRectSize=Vector2.new(144,144)L.middleImages[D].ImageTransparency=A[D]L.middleImages[D].AnchorPoint=Vector2.new(.5,.5)L.middleImages[D].ZIndex=9 L.middleImages[D].Parent=L.thumbstickFrame end local m=nil local function V()if m then m:Disconnect()m=nil end local A=workspace.CurrentCamera if A then m=(A:GetPropertyChangedSignal("\086\105\101\119\112\111\114\116\083\105\122\101")):Connect(function()local L=A.ViewportSize U(L.X<L.Y)end)local L=A.ViewportSize U(L.X<L.Y)end end;(workspace:GetPropertyChangedSignal("\067\117\114\114\101\110\116\067\097\109\101\114\097")):Connect(V)if workspace.CurrentCamera then V()end L.moveTouchStartPosition=nil L.startImageFadeTween=nil L.endImageFadeTween=nil L.middleImageFadeTweens={}L.onRenderSteppedConn=h.RenderStepped:Connect(function()if L.tweenInAlphaStart~=nil then local A=tick()-L.tweenInAlphaStart local D=(L.fadeInAndOutHalfDuration*2)*L.fadeInAndOutBalance L.thumbstickFrame.BackgroundTransparency=1-.35*math.min(A/D,1)if D<A then L.tweenOutAlphaStart=tick()L.tweenInAlphaStart=nil return end elseif L.tweenOutAlphaStart~=nil then local A=tick()-L.tweenOutAlphaStart local D=L.fadeInAndOutHalfDuration*2-(L.fadeInAndOutHalfDuration*2)*L.fadeInAndOutBalance L.thumbstickFrame.BackgroundTransparency=.65+.35*math.min(A/D,1)if D<A then L.tweenOutAlphaStart=nil end end end)L.onTouchEndedConn=T.TouchEnded:connect(function(A)if A==L.moveTouchObject then L:OnInputEnded()end end)D.MenuOpened:connect(function()if L.moveTouchObject then L:OnInputEnded()end end)local b=R:FindFirstChildOfClass("\080\108\097\121\101\114\071\117\105")while not b do R.ChildAdded:wait()b=R:FindFirstChildOfClass("\080\108\097\121\101\114\071\117\105")end local j=true if b.CurrentScreenOrientation~=Enum.ScreenOrientation.LandscapeLeft then j=b.CurrentScreenOrientation==Enum.ScreenOrientation.LandscapeRight end local u=nil u=(b:GetPropertyChangedSignal("\067\117\114\114\101\110\116\083\099\114\101\101\110\079\114\105\101\110\116\097\116\105\111\110")):Connect(function()if not(not j)and b.CurrentScreenOrientation==Enum.ScreenOrientation.Portrait or not j and b.CurrentScreenOrientation~=Enum.ScreenOrientation.Portrait then u:disconnect()L.fadeInAndOutHalfDuration=2.5 L.fadeInAndOutBalance=.05 L.tweenInAlphaStart=tick()if j then L.hasFadedBackgroundInPortrait=true return end L.hasFadedBackgroundInLandscape=true end end)L.thumbstickFrame.Parent=E if game:IsLoaded()then L.fadeInAndOutHalfDuration=2.5 L.fadeInAndOutBalance=.05 L.tweenInAlphaStart=tick()else(coroutine.wrap(function()game.Loaded:Wait()L.fadeInAndOutHalfDuration=2.5 L.fadeInAndOutBalance=.05 L.tweenInAlphaStart=tick()end))()end end return S


local v1 = { 0.10999999999999999, 0.30000000000000004, 0.4, 0.5, 0.6, 0.7, 0.75 };
local l__Players__2 = game:GetService("Players");
local l__GuiService__3 = game:GetService("GuiService");
local l__UserInputService__4 = game:GetService("UserInputService");
local l__RunService__5 = game:GetService("RunService");
local v6 = l__Players__2.LocalPlayer;
if not v6 then
	l__Players__2:GetPropertyChangedSignal("LocalPlayer"):Wait();
	v6 = l__Players__2.LocalPlayer;
end;
local v7 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v8 = setmetatable({}, v7);
v8.__index = v8;
function v8.new()
	local v9 = setmetatable(v7.new(), v8);
	v9.moveTouchObject = nil;
	v9.moveTouchLockedIn = false;
	v9.moveTouchFirstChanged = false;
	v9.moveTouchStartPosition = nil;
	v9.startImage = nil;
	v9.endImage = nil;
	v9.middleImages = {};
	v9.startImageFadeTween = nil;
	v9.endImageFadeTween = nil;
	v9.middleImageFadeTweens = {};
	v9.isFirstTouch = true;
	v9.thumbstickFrame = nil;
	v9.onRenderSteppedConn = nil;
	v9.fadeInAndOutBalance = 0.5;
	v9.fadeInAndOutHalfDuration = 0.3;
	v9.hasFadedBackgroundInPortrait = false;
	v9.hasFadedBackgroundInLandscape = false;
	v9.tweenInAlphaStart = nil;
	v9.tweenOutAlphaStart = nil;
	return v9;
end;
function v8.GetIsJumping(p1)
	p1.isJumping = false;
	return p1.isJumping;
end;
local l__ContextActionService__1 = game:GetService("ContextActionService");
function v8.Enable(p2, p3, p4)
	if p3 == nil then
		return false;
	end;
	if p3 then
		local v10 = true;
	else
		v10 = false;
	end;
	p3 = v10;
	if p2.enabled == p3 then
		return true;
	end;
	if p3 then
		if not p2.thumbstickFrame then
			p2:Create(p4);
		end;
		p2:BindContextActions();
	else
		l__ContextActionService__1:UnbindAction("DynamicThumbstickAction");
		p2:OnInputEnded();
	end;
	p2.enabled = p3;
	p2.thumbstickFrame.Visible = p3;
	return nil;
end;
local u2 = Vector3.new(0, 0, 0);
function v8.OnInputEnded(p5)
	p5.moveTouchObject = nil;
	p5.moveVector = u2;
	p5:FadeThumbstick(false);
end;
local l__TweenService__3 = game:GetService("TweenService");
local u4 = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
function v8.FadeThumbstick(p6, p7)
	if not p7 and p6.moveTouchObject then
		return;
	end;
	if p6.isFirstTouch then
		return;
	end;
	if p6.startImageFadeTween then
		p6.startImageFadeTween:Cancel();
	end;
	if p6.endImageFadeTween then
		p6.endImageFadeTween:Cancel();
	end;
	for v11 = 1, #p6.middleImages do
		if p6.middleImageFadeTweens[v11] then
			p6.middleImageFadeTweens[v11]:Cancel();
		end;
	end;
	if not p7 then
		p6.startImageFadeTween = l__TweenService__3:Create(p6.startImage, u4, {
			ImageTransparency = 1
		});
		p6.startImageFadeTween:Play();
		p6.endImageFadeTween = l__TweenService__3:Create(p6.endImage, u4, {
			ImageTransparency = 1
		});
		p6.endImageFadeTween:Play();
		for v12 = 1, #p6.middleImages do
			p6.middleImageFadeTweens[v12] = l__TweenService__3:Create(p6.middleImages[v12], u4, {
				ImageTransparency = 1
			});
			p6.middleImageFadeTweens[v12]:Play();
		end;
		return;
	end;
	p6.startImageFadeTween = l__TweenService__3:Create(p6.startImage, u4, {
		ImageTransparency = 0
	});
	p6.startImageFadeTween:Play();
	p6.endImageFadeTween = l__TweenService__3:Create(p6.endImage, u4, {
		ImageTransparency = 0.2
	});
	p6.endImageFadeTween:Play();
	for v13 = 1, #p6.middleImages do
		p6.middleImageFadeTweens[v13] = l__TweenService__3:Create(p6.middleImages[v13], u4, {
			ImageTransparency = v1[v13]
		});
		p6.middleImageFadeTweens[v13]:Play();
	end;
end;
function v8.FadeThumbstickFrame(p8, p9, p10)
	p8.fadeInAndOutHalfDuration = p9 * 0.5;
	p8.fadeInAndOutBalance = p10;
	p8.tweenInAlphaStart = tick();
end;
function v8.InputInFrame(p11, p12)
	local l__AbsolutePosition__14 = p11.thumbstickFrame.AbsolutePosition;
	local v15 = l__AbsolutePosition__14 + p11.thumbstickFrame.AbsoluteSize;
	local l__Position__16 = p12.Position;
	if l__AbsolutePosition__14.X <= l__Position__16.X and l__AbsolutePosition__14.Y <= l__Position__16.Y and l__Position__16.X <= v15.X and l__Position__16.Y <= v15.Y then
		return true;
	end;
	return false;
end;
function v8.DoFadeInBackground(p13)
	local v17 = v6:FindFirstChildOfClass("PlayerGui");
	local v18 = false;
	if v17 then
		if v17.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeLeft or v17.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeRight then
			v18 = p13.hasFadedBackgroundInLandscape;
			p13.hasFadedBackgroundInLandscape = true;
		elseif v17.CurrentScreenOrientation == Enum.ScreenOrientation.Portrait then
			v18 = p13.hasFadedBackgroundInPortrait;
			p13.hasFadedBackgroundInPortrait = true;
		end;
	end;
	if not v18 then
		p13.fadeInAndOutHalfDuration = 0.3;
		p13.fadeInAndOutBalance = 0.5;
		p13.tweenInAlphaStart = tick();
	end;
end;
function v8.DoMove(p14, p15)
	if p15.Magnitude < p14.radiusOfDeadZone then
		local v19 = u2;
	else
		local v20 = p15.Unit * (1 - math.max(0, (p14.radiusOfMaxSpeed - p15.Magnitude) / p14.radiusOfMaxSpeed));
		v19 = Vector3.new(v20.X, 0, v20.Y);
	end;
	p14.moveVector = v19;
end;
local u5 = #v1;
function v8.LayoutMiddleImages(p16, p17, p18)
	local v21 = p16.thumbstickSize / 2 + p16.middleSize;
	local v22 = p18 - p17;
	local v23 = v22.Magnitude - p16.thumbstickRingSize / 2 - p16.middleSize;
	local l__Unit__24 = v22.Unit;
	local v25 = p16.middleSpacing;
	if p16.middleSpacing * u5 < v23 then
		v25 = v23 / u5;
	end;
	for v26 = 1, u5 do
		local v27 = nil;
		v27 = p16.middleImages[v26];
		local v28 = v21 + v25 * (v26 - 1);
		if v21 + v25 * (v26 - 2) < v23 then
			local v29 = p18 - l__Unit__24 * v28;
			local v30 = math.clamp(1 - (v28 - v23) / v25, 0, 1);
			v27.Visible = true;
			v27.Position = UDim2.new(0, v29.X, 0, v29.Y);
			v27.Size = UDim2.new(0, p16.middleSize * v30, 0, p16.middleSize * v30);
		else
			v27.Visible = false;
		end;
	end;
end;
function v8.MoveStick(p19, p20)
	local v31 = Vector2.new(p19.moveTouchStartPosition.X, p19.moveTouchStartPosition.Y) - p19.thumbstickFrame.AbsolutePosition;
	local v32 = Vector2.new(p20.X, p20.Y) - p19.thumbstickFrame.AbsolutePosition;
	p19.endImage.Position = UDim2.new(0, v32.X, 0, v32.Y);
	p19:LayoutMiddleImages(v31, v32);
end;
local l__Value__6 = Enum.ContextActionPriority.High.Value;
function v8.BindContextActions(p21)
	local function u7(p22)
		if p21.moveTouchObject then
			return Enum.ContextActionResult.Pass;
		end;
		if not p21:InputInFrame(p22) then
			return Enum.ContextActionResult.Pass;
		end;
		if p21.isFirstTouch then
			p21.isFirstTouch = false;
			local v33 = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0);
			l__TweenService__3:Create(p21.startImage, v33, {
				Size = UDim2.new(0, 0, 0, 0)
			}):Play();
			l__TweenService__3:Create(p21.endImage, v33, {
				Size = UDim2.new(0, p21.thumbstickSize, 0, p21.thumbstickSize), 
				ImageColor3 = Color3.new(0, 0, 0)
			}):Play();
		end;
		p21.moveTouchLockedIn = false;
		p21.moveTouchObject = p22;
		p21.moveTouchStartPosition = p22.Position;
		p21.moveTouchFirstChanged = true;
		p21:DoFadeInBackground();
		return Enum.ContextActionResult.Pass;
	end;
	local function u8(p23)
		if p23 ~= p21.moveTouchObject then
			return Enum.ContextActionResult.Pass;
		end;
		if p21.moveTouchFirstChanged then
			p21.moveTouchFirstChanged = false;
			local v34 = Vector2.new(p23.Position.X - p21.thumbstickFrame.AbsolutePosition.X, p23.Position.Y - p21.thumbstickFrame.AbsolutePosition.Y);
			p21.startImage.Visible = true;
			p21.startImage.Position = UDim2.new(0, v34.X, 0, v34.Y);
			p21.endImage.Visible = true;
			p21.endImage.Position = p21.startImage.Position;
			p21:FadeThumbstick(true);
			p21:MoveStick(p23.Position);
		end;
		p21.moveTouchLockedIn = true;
		local v35 = Vector2.new(p23.Position.X - p21.moveTouchStartPosition.X, p23.Position.Y - p21.moveTouchStartPosition.Y);
		if math.abs(v35.X) > 0 or math.abs(v35.Y) > 0 then
			p21:DoMove(v35);
			p21:MoveStick(p23.Position);
		end;
		return Enum.ContextActionResult.Sink;
	end;
	l__ContextActionService__1:BindActionAtPriority("DynamicThumbstickAction", function(p24, p25, p26)
		if p25 == Enum.UserInputState.Begin then
			return u7(p26);
		end;
		if p25 == Enum.UserInputState.Change then
			return u8(p26);
		end;
		if p25 ~= Enum.UserInputState.End then
			if p25 == Enum.UserInputState.Cancel then
				p21:OnInputEnded();
			end;
			return;
		end;
		if p26 == p21.moveTouchObject then
			p21:OnInputEnded();
			if p21.moveTouchLockedIn then
				return Enum.ContextActionResult.Sink;
			end;
		end;
		return Enum.ContextActionResult.Pass;
	end, false, l__Value__6, Enum.UserInputType.Touch);
end;
function v8.Create(p27, p28)
	if p27.thumbstickFrame then
		p27.thumbstickFrame:Destroy();
		p27.thumbstickFrame = nil;
		if p27.onRenderSteppedConn then
			p27.onRenderSteppedConn:Disconnect();
			p27.onRenderSteppedConn = nil;
		end;
	end;
	p27.thumbstickSize = 45;
	p27.thumbstickRingSize = 20;
	p27.middleSize = 10;
	p27.middleSpacing = p27.middleSize + 4;
	p27.radiusOfDeadZone = 2;
	p27.radiusOfMaxSpeed = 20;
	local l__AbsoluteSize__36 = p28.AbsoluteSize;
	if math.min(l__AbsoluteSize__36.X, l__AbsoluteSize__36.Y) > 500 then
		p27.thumbstickSize = p27.thumbstickSize * 2;
		p27.thumbstickRingSize = p27.thumbstickRingSize * 2;
		p27.middleSize = p27.middleSize * 2;
		p27.middleSpacing = p27.middleSpacing * 2;
		p27.radiusOfDeadZone = p27.radiusOfDeadZone * 2;
		p27.radiusOfMaxSpeed = p27.radiusOfMaxSpeed * 2;
	end;
	local function v37(p29)
		if p29 then
			p27.thumbstickFrame.Size = UDim2.new(1, 0, 0.4, 0);
			p27.thumbstickFrame.Position = UDim2.new(0, 0, 0.6, 0);
			return;
		end;
		p27.thumbstickFrame.Size = UDim2.new(0.4, 0, 0.6666666666666666, 0);
		p27.thumbstickFrame.Position = UDim2.new(0, 0, 0.3333333333333333, 0);
	end;
	p27.thumbstickFrame = Instance.new("Frame");
	p27.thumbstickFrame.BorderSizePixel = 0;
	p27.thumbstickFrame.Name = "DynamicThumbstickFrame";
	p27.thumbstickFrame.Visible = false;
	p27.thumbstickFrame.BackgroundTransparency = 1;
	p27.thumbstickFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0);
	p27.thumbstickFrame.Active = false;
	v37(false);
	p27.startImage = Instance.new("ImageLabel");
	p27.startImage.Name = "ThumbstickStart";
	p27.startImage.Visible = true;
	p27.startImage.BackgroundTransparency = 1;
	p27.startImage.Image = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png";
	p27.startImage.ImageRectOffset = Vector2.new(1, 1);
	p27.startImage.ImageRectSize = Vector2.new(144, 144);
	p27.startImage.ImageColor3 = Color3.new(0, 0, 0);
	p27.startImage.AnchorPoint = Vector2.new(0.5, 0.5);
	p27.startImage.Position = UDim2.new(0, p27.thumbstickRingSize * 3.3, 1, -p27.thumbstickRingSize * 2.8);
	p27.startImage.Size = UDim2.new(0, p27.thumbstickRingSize * 3.7, 0, p27.thumbstickRingSize * 3.7);
	p27.startImage.ZIndex = 10;
	p27.startImage.Parent = p27.thumbstickFrame;
	p27.endImage = Instance.new("ImageLabel");
	p27.endImage.Name = "ThumbstickEnd";
	p27.endImage.Visible = true;
	p27.endImage.BackgroundTransparency = 1;
	p27.endImage.Image = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png";
	p27.endImage.ImageRectOffset = Vector2.new(1, 1);
	p27.endImage.ImageRectSize = Vector2.new(144, 144);
	p27.endImage.AnchorPoint = Vector2.new(0.5, 0.5);
	p27.endImage.Position = p27.startImage.Position;
	p27.endImage.Size = UDim2.new(0, p27.thumbstickSize * 0.8, 0, p27.thumbstickSize * 0.8);
	p27.endImage.ZIndex = 10;
	p27.endImage.Parent = p27.thumbstickFrame;
	for v38 = 1, u5 do
		p27.middleImages[v38] = Instance.new("ImageLabel");
		p27.middleImages[v38].Name = "ThumbstickMiddle";
		p27.middleImages[v38].Visible = false;
		p27.middleImages[v38].BackgroundTransparency = 1;
		p27.middleImages[v38].Image = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png";
		p27.middleImages[v38].ImageRectOffset = Vector2.new(1, 1);
		p27.middleImages[v38].ImageRectSize = Vector2.new(144, 144);
		p27.middleImages[v38].ImageTransparency = v1[v38];
		p27.middleImages[v38].AnchorPoint = Vector2.new(0.5, 0.5);
		p27.middleImages[v38].ZIndex = 9;
		p27.middleImages[v38].Parent = p27.thumbstickFrame;
	end;
	local u9 = nil;
	local function v39()
		if u9 then
			u9:Disconnect();
			u9 = nil;
		end;
		local l__CurrentCamera__40 = workspace.CurrentCamera;
		if l__CurrentCamera__40 then
			u9 = l__CurrentCamera__40:GetPropertyChangedSignal("ViewportSize"):Connect(function()
				local l__ViewportSize__41 = l__CurrentCamera__40.ViewportSize;
				v37(l__ViewportSize__41.X < l__ViewportSize__41.Y);
			end);
			local l__ViewportSize__42 = l__CurrentCamera__40.ViewportSize;
			v37(l__ViewportSize__42.X < l__ViewportSize__42.Y);
		end;
	end;
	workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(v39);
	if workspace.CurrentCamera then
		v39();
	end;
	p27.moveTouchStartPosition = nil;
	p27.startImageFadeTween = nil;
	p27.endImageFadeTween = nil;
	p27.middleImageFadeTweens = {};
	p27.onRenderSteppedConn = l__RunService__5.RenderStepped:Connect(function()
		if p27.tweenInAlphaStart ~= nil then
			local v43 = tick() - p27.tweenInAlphaStart;
			local v44 = p27.fadeInAndOutHalfDuration * 2 * p27.fadeInAndOutBalance;
			p27.thumbstickFrame.BackgroundTransparency = 1 - 0.35 * math.min(v43 / v44, 1);
			if v44 < v43 then
				p27.tweenOutAlphaStart = tick();
				p27.tweenInAlphaStart = nil;
				return;
			end;
		elseif p27.tweenOutAlphaStart ~= nil then
			local v45 = tick() - p27.tweenOutAlphaStart;
			local v46 = p27.fadeInAndOutHalfDuration * 2 - p27.fadeInAndOutHalfDuration * 2 * p27.fadeInAndOutBalance;
			p27.thumbstickFrame.BackgroundTransparency = 0.65 + 0.35 * math.min(v45 / v46, 1);
			if v46 < v45 then
				p27.tweenOutAlphaStart = nil;
			end;
		end;
	end);
	p27.onTouchEndedConn = l__UserInputService__4.TouchEnded:connect(function(p30)
		if p30 == p27.moveTouchObject then
			p27:OnInputEnded();
		end;
	end);
	l__GuiService__3.MenuOpened:connect(function()
		if p27.moveTouchObject then
			p27:OnInputEnded();
		end;
	end);
	local v47 = v6:FindFirstChildOfClass("PlayerGui");
	while not v47 do
		v6.ChildAdded:wait();
		v47 = v6:FindFirstChildOfClass("PlayerGui");	
	end;
	local v48 = true;
	if v47.CurrentScreenOrientation ~= Enum.ScreenOrientation.LandscapeLeft then
		v48 = v47.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeRight;
	end;
	local u10 = nil;
	u10 = v47:GetPropertyChangedSignal("CurrentScreenOrientation"):Connect(function()
		if not (not v48) and v47.CurrentScreenOrientation == Enum.ScreenOrientation.Portrait or not v48 and v47.CurrentScreenOrientation ~= Enum.ScreenOrientation.Portrait then
			u10:disconnect();
			p27.fadeInAndOutHalfDuration = 2.5;
			p27.fadeInAndOutBalance = 0.05;
			p27.tweenInAlphaStart = tick();
			if v48 then
				p27.hasFadedBackgroundInPortrait = true;
				return;
			end;
			p27.hasFadedBackgroundInLandscape = true;
		end;
	end);
	p27.thumbstickFrame.Parent = p28;
	if game:IsLoaded() then
		p27.fadeInAndOutHalfDuration = 2.5;
		p27.fadeInAndOutBalance = 0.05;
		p27.tweenInAlphaStart = tick();
	else
		coroutine.wrap(function()
			game.Loaded:Wait();
			p27.fadeInAndOutHalfDuration = 2.5;
			p27.fadeInAndOutBalance = 0.05;
			p27.tweenInAlphaStart = tick();
		end)();
	end;
end;
return v8;
