Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --print("Hello, World!")
- --print("Hello, World!")
- local setting = {
- mode = "closest", -- opp is FOV
- teamcheck = false,
- wallcheck = false,
- checknpc = false,
- aimbot = false,
- aimpart = "HumanoidRootPart"
- }
- local player = game.Players.LocalPlayer
- local character = player.Character
- local localroot = character:WaitForChild("HumanoidRootPart")
- local head = character:WaitForChild("Head")
- local Cam = workspace.CurrentCamera
- local centerCam = workspace.CurrentCamera.ViewportSize
- game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
- character = char
- localroot = character:WaitForChild("HumanoidRootPart")
- head = character:WaitForChild("Head")
- end)
- local function closest()
- local range = 9999
- local target = nil
- for _, v in pairs(game.Players:GetPlayers()) do
- if v ~= player and v.Character and not v.Character:FindFirstChildWhichIsA("ForceField") then
- if not setting.teamcheck or v.Team ~= player.Team then
- local AS = v.Character:FindFirstChild("HumanoidRootPart")
- local ASD = v.Character:FindFirstChildOfClass("Humanoid")
- if AS and ASD.Health > 0 then
- local dist = (localroot.Position - AS.Position).magnitude
- if dist < range then
- range = dist
- target = v
- end
- end
- end
- end
- end
- return target
- end
- local function closest_check()
- local BH = closest()
- if BH and BH.Character and BH.Character:FindFirstChild("HumanoidRootPart") then
- local JKS = BH.Character:FindFirstChild("HumanoidRootPart")
- local direction = (JKS.Position - head.Position).unit * 1000
- local rayset = RaycastParams.new()
- rayset.FilterType = Enum.RaycastFilterType.Blacklist
- rayset.FilterDescendantsInstances = {character}
- rayset.IgnoreWater = true
- local result = workspace:Raycast(head.Position, direction, rayset)
- if result and result.Instance:IsDescendantOf(BH.Character) then
- return BH
- end
- end
- return nil
- end
- local function closest_npc()
- local range = 9999
- local target = nil
- for _, v in pairs(game.Workspace:GetDescendants()) do
- if v:IsA("Model") and v:FindFirstChild("HumanoidRootPart") and not game.Players:FindFirstChild(v.Name) then
- local vroot = v:FindFirstChild("HumanoidRootPart")
- local vhum = v:FindFirstChildOfClass("Humanoid")
- if vhum.Health > 0 then
- local dist = (localroot.Position - vroot.Position).magnitude
- if dist < range then
- range = dist
- target = v
- end
- end
- end
- end
- return target
- end
- local function closest_npc_check()
- if closest_npc() and closest_npc():FindFirstChild("HumanoidRootPart") then
- local CH = closest_npc():FindFirstChild("HumanoidRootPart")
- local directionJH = (CH.Position - head.Position).unit * 1000
- local rayset = RaycastParams.new()
- rayset.FilterType = Enum.RaycastFilterType.Blacklist
- rayset.FilterDescendantsInstances = {character}
- rayset.IgnoreWater = true
- local result_npc = workspace:Raycast(head.Position, directionJH, rayset)
- if result_npc and result_npc.Instance:IsDescendantOf(closest_npc()) then
- return closest_npc()
- end
- end
- return nil
- end
- if game.CoreGui:FindFirstChild("GUI") then
- game.CoreGui:FindFirstChild("GUI"):Destroy()
- end
- local GUI = Instance.new("ScreenGui", game.CoreGui)
- GUI.Name = "GUI"
- local mainF = Instance.new("Frame", GUI)
- mainF.Size = UDim2.new(0, 150, 0, 100)
- mainF.Position = UDim2.new(0, 100, 0, 0)
- mainF.Name = "My frame"
- mainF.BackgroundColor3 = Color3.new(1, 1, 1)
- mainF.Active = true
- mainF.Draggable = true
- local title = Instance.new("TextLabel", mainF)
- title.Size = UDim2.new(0, 150, 0, 20)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.Name = "My Title"
- title.BackgroundColor3 = Color3.new(1, 1, 1)
- title.Text = "Aimbot GUI v3 by MawinCK"
- title.TextScaled = true
- title.TextWrapped= true
- local aimbotTOGGLE = Instance.new("TextButton", mainF)
- aimbotTOGGLE.Size = UDim2.new(0, 150, 0, 20)
- aimbotTOGGLE.Position = UDim2.new(0, 0, 0, 20)
- aimbotTOGGLE.Name = "My aimbot"
- aimbotTOGGLE.BackgroundColor3 = Color3.fromRGB(255, 17, 0) -- Red lmao
- aimbotTOGGLE.Text = "Aimbot: Off"
- aimbotTOGGLE.TextScaled = true
- aimbotTOGGLE.TextWrapped = true
- -- Next
- local teamC = Instance.new("TextButton", mainF) -- Team Lmao
- teamC.Size = UDim2.new(0, 150, 0, 20)
- teamC.Position = UDim2.new(0, 0, 0, 40)
- teamC.Name = "Team check Button"
- teamC.BackgroundColor3 = Color3.fromRGB(255, 17, 0) -- remember set 17 to 255 if want green(if i forget)
- teamC.Text = "TeamCheck: Off"
- teamC.TextScaled = true
- teamC.TextWrapped = true
- local wallC = Instance.new("TextButton", mainF)
- wallC.Size = UDim2.new(0, 150, 0, 20)
- wallC.Position = UDim2.new(0, 0, 0, 60)
- wallC.Name = "Wall Check Button"
- wallC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- wallC.Text = "WallCheck: Off"
- wallC.TextScaled = true
- wallC.TextWrapped = true
- -- Event For both WallCheck and TeamCheck
- teamC.MouseButton1Click:Connect(function()
- if not setting.teamcheck then
- teamC.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
- teamC.Text = "TeamCheck: On"
- setting.teamcheck = true
- elseif setting.teamcheck then
- teamC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- teamC.Text = "TeamCheck: Off"
- setting.teamcheck = false
- end
- end)
- wallC.MouseButton1Click:Connect(function()
- if not setting.wallcheck then
- wallC.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
- wallC.Text = "WallCheck: On"
- setting.wallcheck = true
- elseif setting.wallcheck then
- wallC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- wallC.Text = "WallCheck: Off"
- setting.wallcheck = false
- end
- end)
- -- Mode Switching
- local switch = Instance.new("TextButton", mainF)
- switch.Size = UDim2.new(0, 150, 0, 20)
- switch.Position = UDim2.new(0, 0, 0, 80)
- switch.Name = "Switch Team"
- switch.BackgroundColor3 = Color3.new(1, 1, 1)
- switch.Text = "Aimbot Mode: closest"
- switch.TextScaled = true
- switch.TextWrapped = true
- switch.MouseButton1Click:Connect(function()
- if setting.mode == "closest" then
- setting.mode = "FOV"
- switch.Text = "Aimbot Mode: FOV"
- elseif setting.mode == "FOV" then
- setting.mode = "closest"
- switch.Text = "Aimbot Mode: closest"
- end
- end)
- local fovrad = Instance.new("TextBox", mainF)
- fovrad.Size = UDim2.new(0, 150, 0, 20)
- fovrad.Position = UDim2.new(0, 0, 0, 100)
- fovrad.Name = "FOV changer"
- fovrad.BackgroundColor3 = Color3.new(1, 1, 1)
- fovrad.Text = "Input Amount of FOV Size Here"
- fovrad.TextScaled = true
- fovrad.TextWrapped = true
- -- SetUp for FOV script Aimbot
- local function IntFOV(def)
- if setting.mode == "FOV" then
- if def and def.Visible ~= true then
- def.Visible = true
- def.Radius = tonumber(fovrad.Text)
- end
- elseif setting.mode ~= "FOV" then
- def.Visible = false
- end
- end
- local FOV = Drawing.new("Circle")
- FOV.Radius = 50
- FOV.Visible = false
- FOV.Position = centerCam / 2
- FOV.Color = Color3.new(1, 1, 1)
- FOV.Filled = false
- FOV.Thickness = 1
- game:GetService("RunService").Heartbeat:Connect(function()
- FOV.Position = centerCam / 2
- end)
- local function FOV_aimbot_plr() -- Replace def with Circle FOV name
- for _, v in pairs(game.Players:GetPlayers()) do
- if v ~= player and v.Character and setting.mode == "FOV" then
- if not setting.teamcheck or v.Team ~= player.Team then
- local vrootv = v.Character:FindFirstChild(setting.aimpart)
- local vhumv = v.Character:FindFirstChildOfClass("Humanoid")
- if vrootv and vhumv.Health > 0 then
- local OnPos, OnScreen = Cam:WorldToViewportPoint(vrootv.Position)
- if OnScreen then
- local distOnScreen = (Vector2.new(OnPos.X, OnPos.Y) - centerCam / 2).magnitude
- if distOnScreen < FOV.Radius then
- Cam.CFrame = CFrame.new(Cam.CFrame.Position, vrootv.Position)
- end
- end
- end
- end
- end
- end
- end
- local function FOV_aimbot_npc()
- for _, v in pairs(game.Workspace:GetDescendants()) do
- if v:IsA("Model") and v:FindFirstChild(setting.aimpart) and not game.Players:FindFirstChild(v.Name) then
- local VZ = v:FindFirstChild(setting.aimpart)
- local ZC = v:FindFirstChildOfClass("Humanoid")
- if ZC.Health > 0 then
- local OnPosVZ, OnScreenVZ = Cam:WorldToViewportPoint(VZ.Position)
- if OnScreenVZ then
- local distOnScreenVZ = (Vector2.new(OnPosVZ.X, OnPosVZ.Y) - centerCam / 2).magnitude
- if distOnScreenVZ < FOV.Radius then
- Cam.CFrame = CFrame.new(Cam.CFrame.Position, VZ.Position)
- end
- end
- end
- end
- end
- end
- local npcC = Instance.new("TextButton", mainF)
- npcC.Size = UDim2.new(0, 150, 0, 20)
- npcC.Position = UDim2.new(0, 0, 0, 120)
- npcC.Name = "My Npc Check Button"
- npcC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- npcC.Text = "Npc Targetting: Off"
- npcC.TextScaled = true
- npcC.TextWrapped = true
- -- Event
- npcC.MouseButton1Click:Connect(function()
- if not setting.checknpc then
- setting.checknpc = true
- npcC.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
- npcC.Text = "Npc Targetting: On"
- elseif setting.checknpc then
- setting.checknpc = false
- npcC.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- npcC.Text = "Npc Targetting: Off"
- end
- end)
- local change = Instance.new("TextButton", mainF)
- change.Size = UDim2.new(0, 150, 0, 20)
- change.Position = UDim2.new(0, 0, 0, 140)
- change.Name = "Change Button"
- change.Text = "Aimbot Aiming: HumanoidRootPart"
- change.TextScaled = true
- change.TextWrapped = true
- change.MouseButton1Click:Connect(function()
- if setting.aimpart == "HumanoidRootPart" then
- setting.aimpart = "Head"
- change.Text = "Aimbot Aiming: Head"
- elseif setting.aimpart == "Head" then
- setting.aimpart = "HumanoidRootPart"
- change.Text = "Aimbot Aiming: HumanoidRootPart"
- end
- end)
- -- Final Event and Scripting
- aimbotTOGGLE.MouseButton1Click:Connect(function()
- if not setting.aimbot then
- setting.aimbot = true
- aimbotTOGGLE.Text = "Aimbot: On"
- aimbotTOGGLE.BackgroundColor3 = Color3.fromRGB(17, 255, 0)
- if not setting.wallcheck and not setting.checknpc and setting.mode == "closest" then
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- local targeter = closest()
- if targeter and targeter.Character and targeter.Character:FindFirstChild(setting.aimpart) then
- local HS = targeter.Character:FindFirstChild(setting.aimpart)
- Cam.CFrame = CFrame.new(Cam.CFrame.Position, HS.Position)
- end
- until setting.wallcheck or setting.checknpc or setting.mode ~= "closest" or not setting.aimbot
- elseif setting.wallcheck and not setting.checknpc and setting.mode == "closest" then -- Lmao
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- local targeted = closest_check()
- if targeted and targeted.Character and targeted.Character:FindFirstChild(setting.aimpart) then
- local JK = targeted.Character:FindFirstChild(setting.aimpart)
- Cam.CFrame = CFrame.new(Cam.CFrame.Position, JK.Position)
- end
- until not setting.wallcheck or setting.checknpc or setting.mode ~= "closest" or not setting.aimbot
- elseif not setting.wallcheck and setting.checknpc and setting.mode == "closest" then
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- if closest_npc() and closest_npc():FindFirstChild(setting.aimpart) then
- local FG = closest_npc():FindFirstChild(setting.aimpart)
- Cam.CFrame = CFrame.new(Cam.CFrame.Position, FG.Position)
- end
- until not setting.aimbot or not setting.checknpc or setting.mode ~= "closest" or setting.wallcheck
- elseif setting.wallcheck and setting.checknpc and setting.mode == "closest" then
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- if closest_npc_check() and closest_npc_check():FindFirstChild(setting.aimpart) then
- local RU = closest_npc_check():FindFirstChild(setting.aimpart)
- Cam.CFrame = CFrame.new(Cam.CFrame.Position, RU.Position)
- end
- until not setting.wallcheck or not setting.checknpc or setting.mode ~= "closest" or not setting.aimbot
- elseif not setting.wallcheck and not setting.checknpc and setting.mode == "FOV" then
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- IntFOV(FOV)
- FOV_aimbot_plr()
- until setting.wallcheck or setting.checknpc or setting.mode ~= "FOV" or not setting.aimbot
- elseif not setting.wallcheck and setting.checknpc and setting.mode == "FOV" then
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- IntFOV(FOV)
- FOV_aimbot_npc()
- until setting.wallcheck or not setting.checknpc or setting.mode ~= "FOV" or not setting.aimbot
- end
- elseif setting.aimbot then
- aimbotTOGGLE.Text = "Aimbot: Off"
- aimbotTOGGLE.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- setting.aimbot = false
- FOV.Visible = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement