Thecodeeasar

Untitled

Feb 19th, 2026
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.22 KB | None | 0 0
  1. local plr=game:GetService("Players").LocalPlayer
  2. local rs=game:GetService("RunService")
  3. local uis=game:GetService("UserInputService")
  4. local cam=workspace.CurrentCamera
  5.  
  6. local gui=Instance.new("ScreenGui")
  7. gui.Name="shiftlockui"
  8. gui.ResetOnSpawn=false
  9. gui.IgnoreGuiInset=true
  10. gui.Parent=plr:WaitForChild("PlayerGui")
  11.  
  12. local btn=Instance.new("TextButton",gui)
  13. btn.Size=UDim2.new(0,60,0,60)
  14. btn.AnchorPoint=Vector2.new(.5,.5)
  15. btn.Position=UDim2.new(.85,0,.5,0)
  16. btn.BackgroundColor3=Color3.fromRGB(0,170,255)
  17. btn.Text=""
  18.  
  19. local c1=Instance.new("UICorner",btn)
  20. c1.CornerRadius=UDim.new(1,0)
  21.  
  22. local outline=Instance.new("Frame",gui)
  23. outline.Size=UDim2.new(0,70,0,70)
  24. outline.AnchorPoint=Vector2.new(.5,.5)
  25. outline.Position=btn.Position
  26. outline.BackgroundTransparency=1
  27. outline.BorderSizePixel=0
  28.  
  29. Instance.new("UICorner",outline).CornerRadius=UDim.new(1,0)
  30.  
  31. local stroke=Instance.new("UIStroke",outline)
  32. stroke.Thickness=3
  33. stroke.Color=Color3.fromRGB(0,255,255)
  34.  
  35. local icon=Instance.new("ImageLabel",btn)
  36. icon.BackgroundTransparency=1
  37. icon.Size=UDim2.new(0,40,0,40)
  38. icon.Position=UDim2.new(.5,-20,.5,-20)
  39. icon.Image="rbxasset://textures/ui/[email protected]"
  40. icon.ImageColor3=Color3.fromRGB(255,60,60)
  41.  
  42. task.spawn(function()
  43.     local pg=plr:WaitForChild("PlayerGui")
  44.     local tg=pg:WaitForChild("TouchGui",5)
  45.     if tg then
  46.         local f=tg:WaitForChild("TouchControlFrame",5)
  47.         if f then
  48.             local j=f:FindFirstChild("JumpButton")
  49.             if j then
  50.                 local p=UDim2.new(j.Position.X.Scale,j.Position.X.Offset-80,j.Position.Y.Scale,j.Position.Y.Offset)
  51.                 btn.Position=p
  52.                 outline.Position=p
  53.             end
  54.         end
  55.     end
  56. end)
  57.  
  58. local conns={}
  59. local function hook(a,b)local k=a:Connect(b)table.insert(conns,k)return k end
  60.  
  61. local dragging=false
  62. local start
  63. local startpos
  64. local t
  65.  
  66. hook(btn.InputBegan,function(i)
  67.     if i.UserInputType==Enum.UserInputType.Touch then
  68.         dragging=true
  69.         t=i
  70.         start=i.Position
  71.         startpos=btn.Position
  72.     end
  73. end)
  74.  
  75. hook(btn.InputEnded,function(i)
  76.     if i==t then dragging=false t=nil end
  77. end)
  78.  
  79. hook(uis.InputChanged,function(i)
  80.     if dragging and i==t then
  81.         local d=i.Position-start
  82.         local np=UDim2.new(startpos.X.Scale,startpos.X.Offset+d.X,startpos.Y.Scale,startpos.Y.Offset+d.Y)
  83.         btn.Position=np
  84.         outline.Position=np
  85.     end
  86. end)
  87.  
  88. local enabled=false
  89. local off=Vector3.new(1.7,.5,0)
  90.  
  91. hook(btn.MouseButton1Click,function()
  92.     enabled=not enabled
  93.     if enabled then
  94.         icon.ImageColor3=Color3.fromRGB(60,255,60)
  95.         if plr.Character and plr.Character:FindFirstChild("Humanoid") then
  96.             plr.Character.Humanoid.AutoRotate=false
  97.         end
  98.         uis.MouseIconEnabled=false
  99.     else
  100.         icon.ImageColor3=Color3.fromRGB(255,60,60)
  101.         if plr.Character and plr.Character:FindFirstChild("Humanoid") then
  102.             plr.Character.Humanoid.AutoRotate=true
  103.             plr.Character.Humanoid.CameraOffset=Vector3.new()
  104.         end
  105.         uis.MouseIconEnabled=true
  106.     end
  107. end)
  108.  
  109. hook(rs.RenderStepped,function()
  110.     if not enabled then return end
  111.     local ch=plr.Character
  112.     if not ch then return end
  113.     local hum=ch:FindFirstChild("Humanoid")
  114.     local root=ch:FindFirstChild("HumanoidRootPart")
  115.     if hum and root then
  116.         hum.CameraOffset=off
  117.         local lv=cam.CFrame.LookVector
  118.         root.CFrame=CFrame.new(root.Position,root.Position+Vector3.new(lv.X,0,lv.Z))
  119.     end
  120. end)
Advertisement
Add Comment
Please, Sign In to add comment