TheUnknownDiscord

camera zoom

Dec 31st, 2021 (edited)
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local billboard = Instance.new("ScreenGui", owner.PlayerGui)
  2. billboard.Name = "the"
  3. cloakmeter = Instance.new("Frame",billboard)
  4. cloakmeter.BackgroundColor3 = Color3.fromRGB(225,225,225)
  5. cloakmeter.Size = UDim2.new(0.25,0,0.0078125,0)
  6. cloakmeter.Active = true
  7. cloakmeter.BackgroundTransparency = 0
  8. cloakmeter.AnchorPoint = Vector2.new(0.5, 0.01)
  9. cloakmeter.Position = UDim2.new(0.5, 0, 0.01, 0)
  10. cloakmeter2 = Instance.new("Frame",billboard)
  11. cloakmeter2.BackgroundColor3 = Color3.fromRGB(225,225,225)
  12. cloakmeter2.Size = UDim2.new(0.00390625,0,0.03125,0)
  13. cloakmeter2.Active = true
  14. cloakmeter2.BackgroundTransparency = 0
  15. cloakmeter2.AnchorPoint = Vector2.new(0.4, 0)
  16. cloakmeter2.Position = UDim2.new(0.4, 0, 0, 0)
  17. cloakmeter2.Name = "the2"
  18. NLS([[
  19. cloakmeter2 = owner.PlayerGui:WaitForChild("the"):WaitForChild("the2")
  20. local UserInputService = game:GetService("UserInputService")
  21. local TweenService = game:GetService("TweenService")
  22. local goal2 = {}
  23. goal2.FieldOfView = 70
  24. local tweenInfo = TweenInfo.new(.5)
  25. local tween2 = TweenService:Create(workspace.CurrentCamera, tweenInfo, goal2)
  26. mouse = owner:GetMouse()
  27. zoom = 0
  28. down = false
  29. local og = UserInputService.MouseDeltaSensitivity
  30. function zoomedin()
  31. local TweenService = game:GetService("TweenService")
  32. if zoom == 0 then
  33. local tweenInfo = TweenInfo.new(.5)
  34. local goal3 = {}
  35. goal3.Position = UDim2.new(0.4, 0, 0, 0)
  36. cloakmeter2.AnchorPoint = Vector2.new(0.4, 0)
  37. local tween3 = TweenService:Create(cloakmeter2, tweenInfo, goal3)
  38. tween3:Play()
  39. elseif zoom == 1 then
  40. local tweenInfo = TweenInfo.new(.5)
  41. local goal3 = {}
  42. goal3.Position = UDim2.new(0.45, 0, 0, 0)
  43. cloakmeter2.AnchorPoint = Vector2.new(0.45, 0)
  44. local tween3 = TweenService:Create(cloakmeter2, tweenInfo, goal3)
  45. tween3:Play()
  46. elseif zoom == 2 then
  47. local tweenInfo = TweenInfo.new(.5)
  48. local goal3 = {}
  49. goal3.Position = UDim2.new(0.5, 0, 0, 0)
  50. cloakmeter2.AnchorPoint = Vector2.new(0.5, 0)
  51. local tween3 = TweenService:Create(cloakmeter2, tweenInfo, goal3)
  52. tween3:Play()
  53. elseif zoom == 3 then
  54. local tweenInfo = TweenInfo.new(.5)
  55. local goal3 = {}
  56. goal3.Position = UDim2.new(0.55, 0, 0, 0)
  57. cloakmeter2.AnchorPoint = Vector2.new(0.55, 0)
  58. local tween3 = TweenService:Create(cloakmeter2, tweenInfo, goal3)
  59. tween3:Play()
  60. elseif zoom == 4 then
  61. local tweenInfo = TweenInfo.new(.5)
  62. local goal3 = {}
  63. goal3.Position = UDim2.new(0.6, 0, 0, 0)
  64. cloakmeter2.AnchorPoint = Vector2.new(0.6, 0)
  65. local tween3 = TweenService:Create(cloakmeter2, tweenInfo, goal3)
  66. tween3:Play()
  67. end
  68. if down then
  69. if zoom == 0 then
  70. UserInputService.MouseDeltaSensitivity = 0.75
  71. local TweenService = game:GetService("TweenService")
  72. local goal = {}
  73. goal.FieldOfView = 50
  74. local tweenInfo = TweenInfo.new(.5)
  75. local tween = TweenService:Create(workspace.CurrentCamera, tweenInfo, goal)
  76. tween:Play()
  77. elseif zoom == 1 then
  78. UserInputService.MouseDeltaSensitivity = 0.55
  79. local TweenService = game:GetService("TweenService")
  80. local goal = {}
  81. goal.FieldOfView = 35
  82. local tweenInfo = TweenInfo.new(.5)
  83. local tween = TweenService:Create(workspace.CurrentCamera, tweenInfo, goal)
  84. tween:Play()
  85. elseif zoom == 2 then
  86. UserInputService.MouseDeltaSensitivity = 0.35
  87. local TweenService = game:GetService("TweenService")
  88. local goal = {}
  89. goal.FieldOfView = 20
  90. local tweenInfo = TweenInfo.new(.5)
  91. local tween = TweenService:Create(workspace.CurrentCamera, tweenInfo, goal)
  92. tween:Play()
  93. elseif zoom == 3 then
  94. UserInputService.MouseDeltaSensitivity = 0.15
  95. local TweenService = game:GetService("TweenService")
  96. local goal = {}
  97. goal.FieldOfView = 5
  98. local tweenInfo = TweenInfo.new(.5)
  99. local tween = TweenService:Create(workspace.CurrentCamera, tweenInfo, goal)
  100. tween:Play()
  101. elseif zoom == 4 then
  102. UserInputService.MouseDeltaSensitivity = 0.03
  103. local TweenService = game:GetService("TweenService")
  104. local goal = {}
  105. goal.FieldOfView = 1
  106. local tweenInfo = TweenInfo.new(.5)
  107. local tween = TweenService:Create(workspace.CurrentCamera, tweenInfo, goal)
  108. tween:Play()
  109. end
  110. end
  111. end
  112. mouse.KeyDown:Connect(function(key)
  113. key = key:lower()
  114. if key == "q" then
  115. zoom += 1
  116. if zoom == 5 then
  117. zoom = 0
  118. end
  119. zoomedin()
  120. elseif key == "e" then
  121. zoom -= 1
  122. if zoom == -1 then
  123. zoom = 4
  124. end
  125. zoomedin()
  126. elseif key == "z" then
  127. down = true
  128. zoomedin()
  129. end
  130. end)
  131. mouse.KeyUp:Connect(function(key)
  132. key = key:lower()
  133. if key == "z" then
  134. down = false
  135. tween2:Play()
  136. UserInputService.MouseDeltaSensitivity = og
  137. end
  138. end)
  139. ]],owner.PlayerGui)
  140. print("z is to zoom")
  141. print("q and e is to cycle between the 5 different zoom levels")
RAW Paste Data Copied