Advertisement
O2BITOg

Fov changer gui

Jun 16th, 2023
4,193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.16 KB | None | 0 0
  1. player = game.Players.LocalPlayer
  2.  
  3. mouse = player:GetMouse()
  4.  
  5. gui = nil
  6. getgui = game:GetObjects("rbxassetid://12701698194")
  7. for i,v in pairs(getgui) do
  8.     gui = v
  9. end
  10. gui.Parent = player.PlayerGui
  11.  
  12. player.CameraMaxZoomDistance = math.huge
  13.  
  14. mouseletgo = false
  15.  
  16. cam = workspace.CurrentCamera
  17.  
  18. XOFF = 0
  19. YOFF = 0
  20. ZOFF = 0
  21. FOV = 0.5
  22.  
  23. gui.base.slider1.knob.MouseButton1Down:Connect(function()
  24.     while task.wait() do
  25.         if mouseletgo == true then break end
  26.         local reletivepos = mouse.X - gui.base.slider1.AbsolutePosition.X
  27.         local percentage = math.clamp(reletivepos / gui.base.slider1.AbsoluteSize.X,0,1)
  28.         FOV = percentage
  29.         gui.base.slider1.knob.Rotation = percentage*360-180
  30.         gui.base.slider1.knob.Position = UDim2.new(percentage - 0.035 ,0, -0.8, 0)
  31.     end
  32. end)
  33.  
  34. gui.base.slider2.knob.MouseButton1Down:Connect(function()
  35.     while task.wait() do
  36.         if mouseletgo == true then break end
  37.         local reletivepos = mouse.X - gui.base.slider2.AbsolutePosition.X
  38.         local percentage = math.clamp(reletivepos / gui.base.slider2.AbsoluteSize.X,0,1)
  39.         XOFF = percentage*10-5
  40.         gui.base.slider2.knob.Rotation = percentage*360-180
  41.         gui.base.slider2.knob.Position = UDim2.new(percentage - 0.035 ,0, -0.8, 0)
  42.     end
  43. end)
  44.  
  45. gui.base.slider3.knob.MouseButton1Down:Connect(function()
  46.     while task.wait() do
  47.         if mouseletgo == true then break end
  48.         local reletivepos = mouse.X - gui.base.slider3.AbsolutePosition.X
  49.         local percentage = math.clamp(reletivepos / gui.base.slider3.AbsoluteSize.X,0,1)
  50.         YOFF = percentage*10-5
  51.         gui.base.slider3.knob.Rotation = percentage*360-180
  52.         gui.base.slider3.knob.Position = UDim2.new(percentage - 0.035 ,0, -0.8, 0)
  53.     end
  54. end)
  55.  
  56. gui.base.slider4.knob.MouseButton1Down:Connect(function()
  57.     while task.wait() do
  58.         if mouseletgo == true then break end
  59.         local reletivepos = mouse.X - gui.base.slider4.AbsolutePosition.X
  60.         local percentage = math.clamp(reletivepos / gui.base.slider4.AbsoluteSize.X,0,1)
  61.         ZOFF = percentage*10-5
  62.         gui.base.slider4.knob.Rotation = percentage*360-180
  63.         gui.base.slider4.knob.Position = UDim2.new(percentage - 0.035 ,0, -0.8, 0)
  64.     end
  65. end)
  66.  
  67.  
  68. mouse.Button1Up:Connect(function()
  69.     mouseletgo = true
  70.     task.wait()
  71.     mouseletgo = false
  72. end)
  73. gui.base.slider1.knob.MouseButton1Up:Connect(function()
  74.     mouseletgo = true
  75.     task.wait()
  76.     mouseletgo = false
  77. end)
  78. gui.base.slider2.knob.MouseButton1Up:Connect(function()
  79.     mouseletgo = true
  80.     task.wait()
  81.     mouseletgo = false
  82. end)
  83. gui.base.slider3.knob.MouseButton1Up:Connect(function()
  84.     mouseletgo = true
  85.     task.wait()
  86.     mouseletgo = false
  87. end)
  88. gui.base.slider4.knob.MouseButton1Up:Connect(function()
  89.     mouseletgo = true
  90.     task.wait()
  91.     mouseletgo = false
  92. end)
  93.  
  94.  
  95. game:GetService("RunService").RenderStepped:connect(function()
  96.     cam.CoordinateFrame=cam.CoordinateFrame*CFrame.new(0,0,0,FOV+0.001,0,0,0,FOV+0.001,0,0,0,1)
  97.     player.Character.Humanoid.CameraOffset = Vector3.new(XOFF,YOFF,ZOFF)
  98. end)
  99.  
  100.  
  101. local TweenService = game:GetService("TweenService")
  102.  
  103. ttoggle = false
  104. gui.base.hidebutton.MouseButton1Up:Connect(function()
  105.     if ttoggle == false then do
  106.             ttoggle = true
  107.             local targetPosition = UDim2.new(-0.25, 0, 0.546, 0)
  108.             local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Bounce)
  109.             local tween = TweenService:Create(gui.base, tweenInfo, {Position = targetPosition})
  110.             tween:Play()
  111.            
  112.             local targetRotation = 0
  113.             local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Bounce)
  114.             local tween = TweenService:Create(gui.base.arrow, tweenInfo, {Rotation = targetRotation})
  115.             tween:Play()
  116.            
  117.         end else
  118.         ttoggle = false
  119.         local targetPosition = UDim2.new(-0.005, 0, 0.546, 0)
  120.         local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Bounce)
  121.         local tween = TweenService:Create(gui.base, tweenInfo, {Position = targetPosition})
  122.         tween:Play()
  123.        
  124.         local targetRotation = 180
  125.         local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Bounce)
  126.         local tween = TweenService:Create(gui.base.arrow, tweenInfo, {Rotation = targetRotation})
  127.         tween:Play()
  128.     end
  129. end)
  130.  
  131.  
  132. while wait() do
  133.     gui.base.outline.UIGradient.Rotation += 0.2
  134.     gui.base.cred2.UIGradient.Rotation += 0.2
  135.     gui.base.hidebutton.Rotation += 0.2
  136.     gui.base.hidebutton.UIStroke.UIGradient.Rotation -= 0.5
  137. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement