Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr=game:GetService("Players").LocalPlayer
- local rs=game:GetService("RunService")
- local uis=game:GetService("UserInputService")
- local cam=workspace.CurrentCamera
- local gui=Instance.new("ScreenGui")
- gui.Name="shiftlockui"
- gui.ResetOnSpawn=false
- gui.IgnoreGuiInset=true
- gui.Parent=plr:WaitForChild("PlayerGui")
- local btn=Instance.new("TextButton",gui)
- btn.Size=UDim2.new(0,60,0,60)
- btn.AnchorPoint=Vector2.new(.5,.5)
- btn.Position=UDim2.new(.85,0,.5,0)
- btn.BackgroundColor3=Color3.fromRGB(0,170,255)
- btn.Text=""
- local c1=Instance.new("UICorner",btn)
- c1.CornerRadius=UDim.new(1,0)
- local outline=Instance.new("Frame",gui)
- outline.Size=UDim2.new(0,70,0,70)
- outline.AnchorPoint=Vector2.new(.5,.5)
- outline.Position=btn.Position
- outline.BackgroundTransparency=1
- outline.BorderSizePixel=0
- Instance.new("UICorner",outline).CornerRadius=UDim.new(1,0)
- local stroke=Instance.new("UIStroke",outline)
- stroke.Thickness=3
- stroke.Color=Color3.fromRGB(0,255,255)
- local icon=Instance.new("ImageLabel",btn)
- icon.BackgroundTransparency=1
- icon.Size=UDim2.new(0,40,0,40)
- icon.Position=UDim2.new(.5,-20,.5,-20)
- icon.ImageColor3=Color3.fromRGB(255,60,60)
- task.spawn(function()
- local pg=plr:WaitForChild("PlayerGui")
- local tg=pg:WaitForChild("TouchGui",5)
- if tg then
- local f=tg:WaitForChild("TouchControlFrame",5)
- if f then
- local j=f:FindFirstChild("JumpButton")
- if j then
- local p=UDim2.new(j.Position.X.Scale,j.Position.X.Offset-80,j.Position.Y.Scale,j.Position.Y.Offset)
- btn.Position=p
- outline.Position=p
- end
- end
- end
- end)
- local conns={}
- local function hook(a,b)local k=a:Connect(b)table.insert(conns,k)return k end
- local dragging=false
- local start
- local startpos
- local t
- hook(btn.InputBegan,function(i)
- if i.UserInputType==Enum.UserInputType.Touch then
- dragging=true
- t=i
- start=i.Position
- startpos=btn.Position
- end
- end)
- hook(btn.InputEnded,function(i)
- if i==t then dragging=false t=nil end
- end)
- hook(uis.InputChanged,function(i)
- if dragging and i==t then
- local d=i.Position-start
- local np=UDim2.new(startpos.X.Scale,startpos.X.Offset+d.X,startpos.Y.Scale,startpos.Y.Offset+d.Y)
- btn.Position=np
- outline.Position=np
- end
- end)
- local enabled=false
- local off=Vector3.new(1.7,.5,0)
- hook(btn.MouseButton1Click,function()
- enabled=not enabled
- if enabled then
- icon.ImageColor3=Color3.fromRGB(60,255,60)
- if plr.Character and plr.Character:FindFirstChild("Humanoid") then
- plr.Character.Humanoid.AutoRotate=false
- end
- uis.MouseIconEnabled=false
- else
- icon.ImageColor3=Color3.fromRGB(255,60,60)
- if plr.Character and plr.Character:FindFirstChild("Humanoid") then
- plr.Character.Humanoid.AutoRotate=true
- plr.Character.Humanoid.CameraOffset=Vector3.new()
- end
- uis.MouseIconEnabled=true
- end
- end)
- hook(rs.RenderStepped,function()
- if not enabled then return end
- local ch=plr.Character
- if not ch then return end
- local hum=ch:FindFirstChild("Humanoid")
- local root=ch:FindFirstChild("HumanoidRootPart")
- if hum and root then
- hum.CameraOffset=off
- local lv=cam.CFrame.LookVector
- root.CFrame=CFrame.new(root.Position,root.Position+Vector3.new(lv.X,0,lv.Z))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment