Advertisement
Err_Natsuki

Shiftlock script (no bug real)!

Jul 5th, 2023
26,647
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 1 0
  1. -- Hella mode ReMAKE
  2.  
  3. local ShiftLockScreenGui = Instance.new("ScreenGui")
  4. local ShiftLockButton = Instance.new("ImageButton")
  5. local ShiftlockCursor = Instance.new("ImageLabel")
  6. local CoreGui = game:GetService("CoreGui")
  7. local Players = game:GetService("Players")
  8. local RunService = game:GetService("RunService")
  9. local ContextActionService = game:GetService("ContextActionService")
  10. local Player = Players.LocalPlayer
  11. local UserInputService = game:GetService("UserInputService")
  12. local States = {
  13. Off = "rbxasset://textures/ui/[email protected]",
  14. On = "rbxasset://textures/ui/[email protected]",
  15. Lock = "rbxasset://textures/MouseLockedCursor.png",
  16. Lock2 = "rbxasset://SystemCursors/Cross"
  17. }
  18. local MaxLength = 900000
  19. local EnabledOffset = CFrame.new(1.7, 0, 0)
  20. local DisabledOffset = CFrame.new(-1.7, 0, 0)
  21. local Active
  22.  
  23. ShiftLockScreenGui.Name = "Shiftlock (CoreGui)"
  24. ShiftLockScreenGui.Parent = CoreGui
  25. ShiftLockScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  26. ShiftLockScreenGui.ResetOnSpawn = false
  27.  
  28. ShiftLockButton.Parent = ShiftLockScreenGui
  29. ShiftLockButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  30. ShiftLockButton.BackgroundTransparency = 1.000
  31. ShiftLockButton.Position = UDim2.new(0.8, 0, 0.35, 0)
  32. ShiftLockButton.Size = UDim2.new(0.0636147112, 0, 0.0661305636, 0)
  33. ShiftLockButton.SizeConstraint = Enum.SizeConstraint.RelativeXX
  34. ShiftLockButton.Image = States.Off
  35.  
  36. ShiftlockCursor.Name = "Shiftlock Cursor"
  37. ShiftlockCursor.Parent = ShiftLockScreenGui
  38. ShiftlockCursor.Image = States.Lock
  39. ShiftlockCursor.Size = UDim2.new(0.03, 0, 0.03, 0)
  40. ShiftlockCursor.Position = UDim2.new(0.5, 0, 0.5, 0)
  41. ShiftlockCursor.AnchorPoint = Vector2.new(0.5, 0.5)
  42. ShiftlockCursor.SizeConstraint = Enum.SizeConstraint.RelativeXX
  43. ShiftlockCursor.BackgroundTransparency = 1
  44. ShiftlockCursor.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  45. ShiftlockCursor.Visible = false
  46.  
  47. ShiftLockButton.MouseButton1Click:Connect(
  48. function()
  49. if not Active then
  50. Active =
  51. RunService.RenderStepped:Connect(
  52. function()
  53. Player.Character.Humanoid.AutoRotate = false
  54. ShiftLockButton.Image = States.On
  55. ShiftlockCursor.Visible = true
  56. Player.Character.HumanoidRootPart.CFrame =
  57. CFrame.new(
  58. Player.Character.HumanoidRootPart.Position,
  59. Vector3.new(
  60. workspace.CurrentCamera.CFrame.LookVector.X * MaxLength,
  61. Player.Character.HumanoidRootPart.Position.Y,
  62. workspace.CurrentCamera.CFrame.LookVector.Z * MaxLength
  63. )
  64. )
  65. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * EnabledOffset
  66. workspace.CurrentCamera.Focus =
  67. CFrame.fromMatrix(
  68. workspace.CurrentCamera.Focus.Position,
  69. workspace.CurrentCamera.CFrame.RightVector,
  70. workspace.CurrentCamera.CFrame.UpVector
  71. ) * EnabledOffset
  72. end
  73. )
  74. else
  75. Player.Character.Humanoid.AutoRotate = true
  76. ShiftLockButton.Image = States.Off
  77. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * DisabledOffset
  78. ShiftlockCursor.Visible = false
  79. pcall(
  80. function()
  81. Active:Disconnect()
  82. Active = nil
  83. end
  84. )
  85. end
  86. end
  87. )
  88.  
  89. local ShiftLockAction = ContextActionService:BindAction("Shift Lock", ShiftLock, false, "On")
  90. ContextActionService:SetPosition("Shift Lock", UDim2.new(0.8, 0, 0.8, 0))
  91.  
  92. return {} and ShiftLockAction
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement