Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Script Starts Here
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local Aimbot = false
- local function FindPart()
- local NearestPart = nil
- local NearestDistance = math.huge
- for _, Part in pairs(workspace:GetDescendants()) do
- if Part.Name == "Part" and Part.Color == Color3.fromRGB(255, 0, 0) then
- local Distance = (Part.Position - Mouse.Hit.p).magnitude
- if Distance < NearestDistance then
- NearestDistance = Distance
- NearestPart = Part
- end
- end
- end
- return NearestPart
- end
- Mouse.Button1Down:connect(function()
- if Aimbot == true then
- local Part = FindPart()
- if Part then
- Mouse.Target = Part.Position
- end
- end
- end)
- -- Gui Code Starts Here
- local Gui = Instance.new("ScreenGui", Player:WaitForChild("PlayerGui"))
- local Frame = Instance.new("Frame", Gui)
- Frame.Size = UDim2.new(0, 200, 0, 50)
- Frame.Position = UDim2.new(0.5, -100, 0.5, -25)
- Frame.Style = "RobloxRound"
- local Label = Instance.new("TextLabel", Frame)
- Label.Size = UDim2.new(1, 0, 1, 0)
- Label.BackgroundTransparency = 1
- Label.TextScaled = true
- Label.Text = "Aimbot"
- local Button = Instance.new("TextButton", Frame)
- Button.Size = UDim2.new(0.5, 0, 1, 0)
- Button.Position = UDim2.new(0, 0, 0, 0)
- Button.Style = "RobloxButtonDefault"
- Button.Text = "Toggle"
- Button.MouseButton1Click:connect(function()
- Aimbot = not Aimbot
- if Aimbot then
- Button.Text = "ON"
- else
- Button.Text = "OFF"
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement