Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Tweakified, Neonblox Games
- -- Video: https://www.youtube.com/watch?v=4GcgE8Qj7QE
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local player = game.Players.LocalPlayer
- local PlayerGui = player:WaitForChild("PlayerGui")
- local ScreenGui = script.Parent
- local MainFrame = ScreenGui:FindFirstChild("Frame")
- local ControllerButton = MainFrame:FindFirstChild("Controller"):FindFirstChild("ImageButton")
- local MiddleIconFrame = MainFrame:FindFirstChild("MiddleIcon")
- local Active = false
- if UserInputService.TouchEnabled == true then
- MainFrame.Visible = true
- ControllerButton.MouseButton1Click:Connect(function()
- Active = not Active
- MiddleIconFrame.Visible = Active
- end)
- local function MobileShiftLock()
- if Active == true then
- local char = player.Character
- if char ~= nil then
- local Head = char:FindFirstChild("Head")
- local HumanoidRootPart = char:FindFirstChild("HumanoidRootPart")
- local Humanoid = char:FindFirstChild("Humanoid")
- local Camera = workspace.CurrentCamera
- if HumanoidRootPart ~= nil and Humanoid.Sit == false then
- local LookVector = Camera.CFrame.LookVector
- HumanoidRootPart.CFrame = CFrame.new(HumanoidRootPart.Position) * CFrame.Angles(0, math.atan2(-LookVector.X, -LookVector.Z), 0)
- end
- if Head ~= nil then
- local InFirstPerson = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude
- InFirstPerson = (InFirstPerson<2) and (1.0-(InFirstPerson-0.5)/1.5) or 0
- if InFirstPerson < 0.5 then
- Camera.CFrame = Camera.CFrame * CFrame.new(1.75, 0, 0)
- end
- end
- end
- end
- end
- RunService:BindToRenderStep("MobileShiftLock", 201, MobileShiftLock)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement