Eproq012

You

Oct 12th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 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 AutoShootState = false
  6. local clickInterval = 0.5
  7. local enemy = nil
  8.  
  9. local function IsWallBetween(localPlayer, targetPart)
  10. local origin = localPlayer.Character.HumanoidRootPart.Position
  11. local direction = (targetPart.Position - origin).unit * (targetPart.Position - origin).magnitude
  12. local raycastParams = RaycastParams.new()
  13. raycastParams.FilterDescendantsInstances = {localPlayer.Character}
  14. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  15. local ray = workspace:Raycast(origin, direction, raycastParams)
  16.  
  17. return ray and ray.Instance and ray.Instance:IsDescendantOf(workspace) and not ray.Instance:IsDescendantOf(targetPart.Parent)
  18. end
  19.  
  20. local function autoShoot()
  21. local tool = LocalPlayer.Character:FindFirstChildOfClass("Tool")
  22. if tool and tool:FindFirstChild("Handle") then
  23. tool:Activate()
  24. end
  25. end
  26.  
  27. local function startAutoShoot()
  28. while AutoShootState do
  29. if enemy and not IsWallBetween(LocalPlayer, enemy) then
  30. autoShoot()
  31. end
  32. wait(clickInterval)
  33. end
  34. end
  35.  
  36. local AutoShootGUI = Instance.new("ScreenGui")
  37. local AutoShootFrame = Instance.new("Frame")
  38. local AutoShootButton = Instance.new("TextButton")
  39. local UICorner_2 = Instance.new("UICorner")
  40. local UIStroke_2 = Instance.new("UIStroke")
  41.  
  42. AutoShootGUI.Name = "AutoShootGUI"
  43. AutoShootGUI.Parent = game.CoreGui
  44. AutoShootGUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  45.  
  46. AutoShootFrame.Parent = AutoShootGUI
  47. AutoShootFrame.BackgroundColor3 = Color3.fromRGB(48, 25, 52)
  48. AutoShootFrame.BorderSizePixel = 0
  49. AutoShootFrame.Position = UDim2.new(0.3, 0, 0.1, 0)
  50. AutoShootFrame.Size = UDim2.new(0, 202, 0, 70)
  51. AutoShootFrame.Active = true
  52. AutoShootFrame.Draggable = true
  53.  
  54. UICorner_2.CornerRadius = UDim.new(0, 12)
  55. UICorner_2.Parent = AutoShootFrame
  56.  
  57. AutoShootButton.Parent = AutoShootFrame
  58. AutoShootButton.BackgroundColor3 = Color3.fromRGB(191, 64, 191)
  59. AutoShootButton.BorderSizePixel = 0
  60. AutoShootButton.Position = UDim2.new(0.079, 0, 0.185, 0)
  61. AutoShootButton.Size = UDim2.new(0, 170, 0, 44)
  62. AutoShootButton.Font = Enum.Font.SourceSansSemibold
  63. AutoShootButton.Text = "AutoShoot OFF"
  64. AutoShootButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  65. AutoShootButton.TextScaled = true
  66. AutoShootButton.TextWrapped = true
  67.  
  68. AutoShootButton.MouseButton1Click:Connect(function()
  69. AutoShootState = not AutoShootState
  70. AutoShootButton.Text = AutoShootState and "AutoShoot ON" or "AutoShoot OFF"
  71.  
  72. if AutoShootState then
  73. startAutoShoot()
  74. end
  75. end)
  76.  
  77. UIStroke_2.Parent = AutoShootFrame
  78. UIStroke_2.Thickness = 2
  79. UIStroke_2.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  80. UIStroke_2.Color = Color3.fromRGB(255, 255, 255)
Add Comment
Please, Sign In to add comment