LocalPlayer = game.GetService(game, 'Players').LocalPlayer UserGameSettings = UserSettings():GetService('UserGameSettings') RunService = game.GetService(game, 'RunService') IsItOn = false UI = { MainGui = Instance.new'ScreenGui', MouseLock = Instance.new'Frame', Container = Instance.new'Frame', Background = Instance.new'Frame', UICorner = Instance.new'UICorner', UIStroke = Instance.new'UIStroke', Icon = Instance.new'Frame', ImageLabel = Instance.new'ImageLabel', UIAspectRatioConstraint = Instance.new'UIAspectRatioConstraint', Button = Instance.new'TextButton', Crosshair = Instance.new'ImageLabel' } UI.MainGui.Name = 'MouseLockGui' UI.MainGui.Parent = gethui() or game.GetService(game, 'CoreGui') UI.MouseLock.Size = UDim2.new(0, 44, 0, 44) UI.MouseLock.BackgroundTransparency = 1 UI.MouseLock.BorderSizePixel = 0 UI.MouseLock.Position = UDim2.new(0, 15, 0, 0) UI.MouseLock.Parent = UI.MainGui UI.Container.Size = UDim2.new(1, 0, 1, 0) UI.Container.BackgroundTransparency = 1 UI.Container.BorderSizePixel = 0 UI.Container.Parent = UI.MouseLock UI.Background.Size = UDim2.new(1, 0, 1, 0) UI.Background.BackgroundColor3 = Color3.fromRGB(18,18,21) UI.Background.BackgroundTransparency = 0.08 UI.Background.BorderSizePixel = 0 UI.Background.Parent = UI.Container UI.UICorner.CornerRadius = UDim.new(1,0) UI.UICorner.Parent = UI.Background UI.UIStroke.Color = Color3.fromRGB(0,170,255) UI.UIStroke.Thickness = 2 UI.UIStroke.Transparency = 0.2 UI.UIStroke.Enabled = false UI.UIStroke.Parent = UI.Background UI.Icon.Size = UDim2.new(1,0,1,0) UI.Icon.BackgroundTransparency = 1 UI.Icon.ZIndex = 5 UI.Icon.Parent = UI.Container UI.ImageLabel.AnchorPoint = Vector2.new(.5,.5) UI.ImageLabel.Position = UDim2.new(.5,0,.5,0) UI.ImageLabel.Size = UDim2.new(.7,0,.7,0) UI.ImageLabel.BackgroundTransparency = 1 UI.ImageLabel.Image = 'rbxassetid://80450981243325' UI.ImageLabel.Parent = UI.Icon UI.UIAspectRatioConstraint.Parent = UI.ImageLabel UI.Button.Size = UDim2.new(1,0,1,0) UI.Button.BackgroundTransparency = 1 UI.Button.ZIndex = 6 UI.Button.Text = '' UI.Button.Parent = UI.Container UI.Crosshair.Name = 'Crosshair' UI.Crosshair.Parent = UI.MainGui UI.Crosshair.Size = UDim2.new(0, 30, 0, 30) UI.Crosshair.Position = UDim2.new(0.5, 0, 0.45, 0) UI.Crosshair.AnchorPoint = Vector2.new(0.5, 0.5) UI.Crosshair.BackgroundTransparency = 1 UI.Crosshair.Image = 'rbxassetid://85514680408407' UI.Crosshair.Visible = false UI.Crosshair.ZIndex = 10 RunService:BindToRenderStep('SmoothTrans', Enum.RenderPriority.Camera.Value + 1, function() if IsItOn ~= true then return end if not workspace.CurrentCamera then return end if ((workspace.CurrentCamera.CFrame.Position - workspace.CurrentCamera.Focus.Position).Magnitude) < .6 then UI.Crosshair.Visible = false else workspace.CurrentCamera.Focus = (workspace.CurrentCamera.CFrame * CFrame.new(1.7,0,0)) * CFrame.new(0,0,-((workspace.CurrentCamera.Focus.Position - workspace.CurrentCamera.CFrame.Position).Magnitude)) workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(1.7,0,0) UI.Crosshair.Visible = true end end) UI.Button.MouseButton1Click:Connect(function() IsItOn = not IsItOn if IsItOn == true then UserGameSettings.RotationType = Enum.RotationType.CameraRelative UI.UIStroke.Enabled = true else UserGameSettings.RotationType = Enum.RotationType.MovementRelative UI.UIStroke.Enabled = false UI.Crosshair.Visible = false end end)