Advertisement
Hunter_Fujinori

twat

May 23rd, 2025 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. -- Services
  2. local Players = game:GetService("Players")
  3. local TweenService = game:GetService("TweenService")
  4. local UserInputService = game:GetService("UserInputService")
  5. local Lighting = game:GetService("Lighting")
  6.  
  7. local player = Players.LocalPlayer
  8. local playerGui = player:WaitForChild("PlayerGui")
  9.  
  10. -- Create ScreenGui
  11. local screenGui = Instance.new("ScreenGui")
  12. screenGui.Name = "AimlockMenuGui"
  13. screenGui.Parent = playerGui
  14. screenGui.ResetOnSpawn = false
  15.  
  16. -- Menu Frame
  17. local menuFrame = Instance.new("Frame")
  18. menuFrame.Size = UDim2.new(0, 500, 0, 400)
  19. menuFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  20. menuFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
  21. menuFrame.BackgroundColor3 = Color3.fromRGB(245, 245, 245)
  22. menuFrame.BackgroundTransparency = 1
  23. menuFrame.BorderSizePixel = 0
  24. menuFrame.Visible = false
  25. menuFrame.ZIndex = 1
  26. menuFrame.Parent = screenGui
  27.  
  28. local corner = Instance.new("UICorner")
  29. corner.CornerRadius = UDim.new(0, 16)
  30. corner.Parent = menuFrame
  31.  
  32. local gradient = Instance.new("UIGradient")
  33. gradient.Color = ColorSequence.new{
  34. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 220)),
  35. ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 230, 150))
  36. }
  37. gradient.Rotation = 45
  38. gradient.Parent = menuFrame
  39.  
  40. local pulseStroke = Instance.new("UIStroke")
  41. pulseStroke.Parent = menuFrame
  42. pulseStroke.Thickness = 3
  43. pulseStroke.Color = Color3.fromRGB(255, 204, 0)
  44. pulseStroke.Transparency = 1
  45. pulseStroke.Enabled = false
  46.  
  47. -- Icon Setup
  48. local iconSize = UDim2.new(0, 50, 0, 50)
  49. local iconStartPos = UDim2.new(0.05, 0, 0.05, 0)
  50. local iconAboveMenuPos = UDim2.new(0.5, 0, 0.5, -menuFrame.Size.Y.Offset/2 - 60)
  51.  
  52. local iconButton = Instance.new("ImageButton")
  53. iconButton.Size = iconSize
  54. iconButton.AnchorPoint = Vector2.new(0.5, 0.5)
  55. iconButton.Position = iconStartPos
  56. iconButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  57. iconButton.ImageTransparency = 0
  58. iconButton.BackgroundTransparency = 0
  59. iconButton.ZIndex = 2
  60. iconButton.Parent = screenGui
  61.  
  62. local iconCorner = Instance.new("UICorner")
  63. iconCorner.CornerRadius = UDim.new(1, 0)
  64. iconCorner.Parent = iconButton
  65.  
  66. local iconOutline = Instance.new("UIStroke")
  67. iconOutline.Parent = iconButton
  68. iconOutline.Color = Color3.fromRGB(255, 204, 0)
  69. iconOutline.Thickness = 2
  70. iconOutline.Transparency = 0
  71.  
  72. -- Set avatar image
  73. local userId = player.UserId
  74. local thumb, _ = Players:GetUserThumbnailAsync(userId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
  75. iconButton.Image = thumb
  76.  
  77. -- Blur effect
  78. local blur = Lighting:FindFirstChild("AimlockMenuBlur") or Instance.new("BlurEffect", Lighting)
  79. blur.Name = "AimlockMenuBlur"
  80. blur.Size = 0
  81.  
  82. -- Toggle logic
  83. local menuOpen = false
  84. local canToggle = true
  85.  
  86. local function tweenAndWait(instance, tweenInfo, properties)
  87. local tween = TweenService:Create(instance, tweenInfo, properties)
  88. tween:Play()
  89. local finished = Instance.new("BindableEvent")
  90. tween.Completed:Connect(function()
  91. finished:Fire()
  92. finished:Destroy()
  93. end)
  94. finished.Event:Wait()
  95. end
  96.  
  97. local function fade(instance, props, duration)
  98. return TweenService:Create(instance, TweenInfo.new(duration), props)
  99. end
  100.  
  101. local function openMenu()
  102. menuFrame.Visible = true
  103. pulseStroke.Enabled = true
  104.  
  105. -- Blur in
  106. tweenAndWait(blur, TweenInfo.new(0.5), {Size = 24})
  107.  
  108. -- Fade out icon fully
  109. tweenAndWait(iconButton, TweenInfo.new(0.2), {ImageTransparency = 1, BackgroundTransparency = 1})
  110. tweenAndWait(iconOutline, TweenInfo.new(0.2), {Transparency = 1})
  111.  
  112. -- Move icon above menu
  113. tweenAndWait(iconButton, TweenInfo.new(0.4), {Position = iconAboveMenuPos})
  114.  
  115. -- Fade icon back in
  116. tweenAndWait(iconButton, TweenInfo.new(0.3), {ImageTransparency = 0, BackgroundTransparency = 0})
  117. tweenAndWait(iconOutline, TweenInfo.new(0.3), {Transparency = 0})
  118.  
  119. -- Fade in menu and stroke
  120. tweenAndWait(menuFrame, TweenInfo.new(0.4), {BackgroundTransparency = 0})
  121. tweenAndWait(pulseStroke, TweenInfo.new(0.4), {Transparency = 0.2})
  122. end
  123.  
  124. local function closeMenu()
  125. -- Fade out menu and stroke
  126. tweenAndWait(menuFrame, TweenInfo.new(0.4), {BackgroundTransparency = 1})
  127. tweenAndWait(pulseStroke, TweenInfo.new(0.4), {Transparency = 1})
  128. pulseStroke.Enabled = false
  129.  
  130. -- Blur out
  131. tweenAndWait(blur, TweenInfo.new(0.5), {Size = 0})
  132.  
  133. -- Fade out icon fully
  134. tweenAndWait(iconButton, TweenInfo.new(0.2), {ImageTransparency = 1, BackgroundTransparency = 1})
  135. tweenAndWait(iconOutline, TweenInfo.new(0.2), {Transparency = 1})
  136.  
  137. -- Move icon back
  138. tweenAndWait(iconButton, TweenInfo.new(0.4), {Position = iconStartPos})
  139.  
  140. -- Fade icon back in
  141. tweenAndWait(iconButton, TweenInfo.new(0.3), {ImageTransparency = 0, BackgroundTransparency = 0})
  142. tweenAndWait(iconOutline, TweenInfo.new(0.3), {Transparency = 0})
  143.  
  144. menuFrame.Visible = false
  145. end
  146.  
  147. local function toggleMenu()
  148. if not canToggle then return end
  149. canToggle = false
  150.  
  151. if menuOpen then
  152. closeMenu()
  153. else
  154. openMenu()
  155. end
  156.  
  157. menuOpen = not menuOpen
  158. task.delay(1, function()
  159. canToggle = true
  160. end)
  161. end
  162.  
  163. -- Inputs
  164. UserInputService.InputBegan:Connect(function(input, gp)
  165. if gp then return end
  166. if input.KeyCode == Enum.KeyCode.Y then
  167. toggleMenu()
  168. end
  169. end)
  170.  
  171. iconButton.MouseButton1Click:Connect(function()
  172. toggleMenu()
  173. end)
  174.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement