Advertisement
Eproq012

Mjor10

Oct 11th, 2024
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.25 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local LocalPlayer = Players.LocalPlayer
  4. local Mouse = game.Players.LocalPlayer:GetMouse()
  5. local CamlockState = false
  6. local AutoShootState = false
  7. local clickInterval = 0.5
  8. local Prediction = 0.2
  9. local XPrediction = 0.15
  10. local YPrediction = 0.15
  11. local enemy = nil
  12. local glowingPart = nil
  13.  
  14. function FindNearestEnemy()
  15. local ClosestDistance, ClosestPlayer = math.huge, nil
  16. local CenterPosition = Vector2.new(game:GetService("GuiService"):GetScreenResolution().X / 2, game:GetService("GuiService"):GetScreenResolution().Y / 2)
  17.  
  18. for _, Player in ipairs(Players:GetPlayers()) do
  19. if Player ~= LocalPlayer then
  20. local Character = Player.Character
  21. if Character and Character:FindFirstChild("HumanoidRootPart") and Character.Humanoid.Health > 0 then
  22. local Position, IsVisibleOnViewport = game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart.Position)
  23. if IsVisibleOnViewport then
  24. local Distance = (CenterPosition - Vector2.new(Position.X, Position.Y)).Magnitude
  25. if Distance < ClosestDistance then
  26. ClosestPlayer = Character.HumanoidRootPart
  27. ClosestDistance = Distance
  28. end
  29. end
  30. end
  31. end
  32. end
  33.  
  34. return ClosestPlayer
  35. end
  36.  
  37. local function IsWallBetween(localPlayer, targetPart)
  38. local origin = localPlayer.Character.HumanoidRootPart.Position
  39. local direction = (targetPart.Position - origin).unit * (targetPart.Position - origin).magnitude
  40. local raycastParams = RaycastParams.new()
  41. raycastParams.FilterDescendantsInstances = {localPlayer.Character}
  42. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  43. local ray = workspace:Raycast(origin, direction, raycastParams)
  44.  
  45. return ray and ray.Instance and ray.Instance:IsDescendantOf(workspace) and not ray.Instance:IsDescendantOf(targetPart.Parent)
  46. end
  47.  
  48. local function autoShoot()
  49. local tool = LocalPlayer.Character:FindFirstChildOfClass("Tool")
  50. if tool and tool:FindFirstChild("Handle") then
  51. tool:Activate()
  52. end
  53. end
  54.  
  55. local function startAutoShoot()
  56. while AutoShootState do
  57. if enemy and not IsWallBetween(LocalPlayer, enemy) then
  58. autoShoot()
  59. end
  60. wait(clickInterval)
  61. end
  62. end
  63.  
  64. RunService.Heartbeat:Connect(function()
  65. if CamlockState and enemy then
  66. local camera = workspace.CurrentCamera
  67. local predictedPosition = enemy.Position + enemy.Velocity * Prediction + Vector3.new(enemy.Velocity.X * XPrediction, enemy.Velocity.Y * YPrediction, 0)
  68.  
  69. camera.CFrame = CFrame.new(camera.CFrame.p, predictedPosition)
  70.  
  71. if glowingPart then
  72. glowingPart.Enabled = true
  73. glowingPart.Parent = enemy
  74. glowingPart.Face = Enum.NormalId.Front
  75. end
  76. else
  77. if glowingPart then
  78. glowingPart:Destroy()
  79. end
  80. end
  81. end)
  82.  
  83. local CamlockGUI = Instance.new("ScreenGui")
  84. local CamlockFrame = Instance.new("Frame")
  85. local CamlockButton = Instance.new("TextButton")
  86. local UICorner_1 = Instance.new("UICorner")
  87. local UIStroke_1 = Instance.new("UIStroke")
  88.  
  89. local AutoShootGUI = Instance.new("ScreenGui")
  90. local AutoShootFrame = Instance.new("Frame")
  91. local AutoShootButton = Instance.new("TextButton")
  92. local UICorner_2 = Instance.new("UICorner")
  93. local UIStroke_2 = Instance.new("UIStroke")
  94.  
  95. CamlockGUI.Name = "CamlockGUI"
  96. CamlockGUI.Parent = game.CoreGui
  97. CamlockGUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  98.  
  99. CamlockFrame.Parent = CamlockGUI
  100. CamlockFrame.BackgroundColor3 = Color3.fromRGB(48, 25, 52)
  101. CamlockFrame.BorderSizePixel = 0
  102. CamlockFrame.Position = UDim2.new(0.1, 0, 0.1, 0)
  103. CamlockFrame.Size = UDim2.new(0, 202, 0, 70)
  104. CamlockFrame.Active = true
  105. CamlockFrame.Draggable = true
  106.  
  107. UICorner_1.CornerRadius = UDim.new(0, 12)
  108. UICorner_1.Parent = CamlockFrame
  109.  
  110. CamlockButton.Parent = CamlockFrame
  111. CamlockButton.BackgroundColor3 = Color3.fromRGB(159, 43, 104)
  112. CamlockButton.BorderSizePixel = 0
  113. CamlockButton.Position = UDim2.new(0.079, 0, 0.185, 0)
  114. CamlockButton.Size = UDim2.new(0, 170, 0, 44)
  115. CamlockButton.Font = Enum.Font.SourceSansSemibold
  116. CamlockButton.Text = "Camlock OFF"
  117. CamlockButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  118. CamlockButton.TextScaled = true
  119. CamlockButton.TextWrapped = true
  120.  
  121. AutoShootGUI.Name = "AutoShootGUI"
  122. AutoShootGUI.Parent = game.CoreGui
  123. AutoShootGUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  124.  
  125. AutoShootFrame.Parent = AutoShootGUI
  126. AutoShootFrame.BackgroundColor3 = Color3.fromRGB(48, 25, 52)
  127. AutoShootFrame.BorderSizePixel = 0
  128. AutoShootFrame.Position = UDim2.new(0.3, 0, 0.1, 0)
  129. AutoShootFrame.Size = UDim2.new(0, 202, 0, 70)
  130. AutoShootFrame.Active = true
  131. AutoShootFrame.Draggable = true
  132.  
  133. UICorner_2.CornerRadius = UDim.new(0, 12)
  134. UICorner_2.Parent = AutoShootFrame
  135.  
  136. AutoShootButton.Parent = AutoShootFrame
  137. AutoShootButton.BackgroundColor3 = Color3.fromRGB(191, 64, 191)
  138. AutoShootButton.BorderSizePixel = 0
  139. AutoShootButton.Position = UDim2.new(0.079, 0, 0.185, 0)
  140. AutoShootButton.Size = UDim2.new(0, 170, 0, 44)
  141. AutoShootButton.Font = Enum.Font.SourceSansSemibold
  142. AutoShootButton.Text = "AutoShoot OFF"
  143. AutoShootButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  144. AutoShootButton.TextScaled = true
  145. AutoShootButton.TextWrapped = true
  146.  
  147. CamlockButton.MouseButton1Click:Connect(function()
  148. CamlockState = not CamlockState
  149. CamlockButton.Text = CamlockState and "Camlock ON" or "Camlock OFF"
  150. enemy = CamlockState and FindNearestEnemy() or nil
  151.  
  152. if CamlockState then
  153. glowingPart = Instance.new("SurfaceLight")
  154. glowingPart.Color = Color3.fromRGB(128, 0, 255)
  155. glowingPart.Brightness = 10
  156. else
  157. if glowingPart then
  158. glowingPart:Destroy()
  159. end
  160. end
  161. end)
  162.  
  163. AutoShootButton.MouseButton1Click:Connect(function()
  164. AutoShootState = not AutoShootState
  165. AutoShootButton.Text = AutoShootState and "AutoShoot ON" or "AutoShoot OFF"
  166.  
  167. if AutoShootState then
  168. startAutoShoot()
  169. end
  170. end)
  171.  
  172. UIStroke_1.Parent = CamlockFrame
  173. UIStroke_1.Thickness = 2
  174. UIStroke_1.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  175. UIStroke_1.Color = Color3.fromRGB(255, 255, 255)
  176.  
  177. UIStroke_2.Parent = AutoShootFrame
  178. UIStroke_2.Thickness = 2
  179. UIStroke_2.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  180. UIStroke_2.Color = Color3.fromRGB(255, 255, 255)
  181.  
  182. local purpleColors = {
  183. Color3.fromRGB(159, 43, 104),
  184. Color3.fromRGB(191, 64, 191),
  185. Color3.fromRGB(128, 0, 32),
  186. Color3.fromRGB(112, 41, 99)
  187. }
  188.  
  189. local function SmoothPurpleRainbowEffect()
  190. local step = 0
  191. while true do
  192. local t = (math.sin(step) + 1) / 2
  193. local colorIndex1 = math.floor(step % #purpleColors) + 1
  194. local colorIndex2 = colorIndex1 % #purpleColors + 1
  195. local color = purpleColors[colorIndex1]:Lerp(purpleColors[colorIndex2], t)
  196.  
  197. UIStroke_1.Color = color
  198. UIStroke_2.Color = color
  199. CamlockButton.TextColor3 = color
  200. AutoShootButton.TextColor3 = color
  201.  
  202. step = step + 0.02
  203. wait(0.01)
  204. end
  205. end
  206.  
  207. spawn(SmoothPurpleRainbowEffect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement