Advertisement
scriptingtales

Ahemdos

Jan 22nd, 2023
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. --Script Starts Here
  2.  
  3. local Player = game.Players.LocalPlayer
  4.  
  5. local Mouse = Player:GetMouse()
  6.  
  7. local Aimbot = false
  8.  
  9. local function FindPart()
  10.  
  11. local NearestPart = nil
  12.  
  13. local NearestDistance = math.huge
  14.  
  15. for _, Part in pairs(workspace:GetDescendants()) do
  16.  
  17. if Part.Name == "Part" and Part.Color == Color3.fromRGB(255, 0, 0) then
  18.  
  19. local Distance = (Part.Position - Mouse.Hit.p).magnitude
  20.  
  21. if Distance < NearestDistance then
  22.  
  23. NearestDistance = Distance
  24.  
  25. NearestPart = Part
  26.  
  27. end
  28.  
  29. end
  30.  
  31. end
  32.  
  33. return NearestPart
  34.  
  35. end
  36.  
  37. Mouse.Button1Down:connect(function()
  38.  
  39. if Aimbot == true then
  40.  
  41. local Part = FindPart()
  42.  
  43. if Part then
  44.  
  45. Mouse.Target = Part.Position
  46.  
  47. end
  48.  
  49. end
  50.  
  51. end)
  52.  
  53. -- Gui Code Starts Here
  54.  
  55. local Gui = Instance.new("ScreenGui", Player:WaitForChild("PlayerGui"))
  56.  
  57. local Frame = Instance.new("Frame", Gui)
  58.  
  59. Frame.Size = UDim2.new(0, 200, 0, 50)
  60.  
  61. Frame.Position = UDim2.new(0.5, -100, 0.5, -25)
  62.  
  63. Frame.Style = "RobloxRound"
  64.  
  65. local Label = Instance.new("TextLabel", Frame)
  66.  
  67. Label.Size = UDim2.new(1, 0, 1, 0)
  68.  
  69. Label.BackgroundTransparency = 1
  70.  
  71. Label.TextScaled = true
  72.  
  73. Label.Text = "Aimbot"
  74.  
  75. local Button = Instance.new("TextButton", Frame)
  76.  
  77. Button.Size = UDim2.new(0.5, 0, 1, 0)
  78.  
  79. Button.Position = UDim2.new(0, 0, 0, 0)
  80.  
  81. Button.Style = "RobloxButtonDefault"
  82.  
  83. Button.Text = "Toggle"
  84.  
  85. Button.MouseButton1Click:connect(function()
  86.  
  87. Aimbot = not Aimbot
  88.  
  89. if Aimbot then
  90.  
  91. Button.Text = "ON"
  92.  
  93. else
  94.  
  95. Button.Text = "OFF"
  96.  
  97. end
  98.  
  99. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement