Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PLAYER = game.Players.LocalPlayer
- MOUSE = PLAYER:GetMouse()
- CC = game.Workspace.CurrentCamera
- ENABLED = false
- ESP_ENABLED = false
- _G.FREE_FOR_ALL = false
- _G.BIND = 50
- _G.CHANGE_AIM = 'q'
- _G.AIM_AT = 'Head'
- wait(1)
- function GetNearestPlayerToMouse()
- local PLAYERS = {}
- local PLAYER_HOLD = {}
- local DISTANCES = {}
- for i, v in pairs(game.Players:GetPlayers()) do
- if v ~= PLAYER and tostring(v.Team) == "Allied Airborne" then
- table.insert(PLAYERS, v)
- end
- end
- for i, v in pairs(PLAYERS) do
- if _G.FREE_FOR_ALL == false then
- if v and (v.Character) ~= nil and tostring(v.Team) == "Allied Airborne" then
- local AIM = v.Character:FindFirstChild(_G.AIM_AT)
- if AIM ~= nil then
- local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
- local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
- local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
- local DIFF = math.floor((POS - AIM.Position).magnitude)
- PLAYER_HOLD[v.Name .. i] = {}
- PLAYER_HOLD[v.Name .. i].dist = DISTANCE
- PLAYER_HOLD[v.Name .. i].plr = v
- PLAYER_HOLD[v.Name .. i].diff = DIFF
- table.insert(DISTANCES, DIFF)
- end
- end
- elseif _G.FREE_FOR_ALL == true then
- local AIM = v.Character:FindFirstChild(_G.AIM_AT)
- if AIM ~= nil then
- local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
- local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
- local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
- local DIFF = math.floor((POS - AIM.Position).magnitude)
- PLAYER_HOLD[v.Name .. i] = {}
- PLAYER_HOLD[v.Name .. i].dist = DISTANCE
- PLAYER_HOLD[v.Name .. i].plr = v
- PLAYER_HOLD[v.Name .. i].diff = DIFF
- table.insert(DISTANCES, DIFF)
- end
- end
- end
- if unpack(DISTANCES) == nil then
- return false
- end
- local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
- if L_DISTANCE > 20 then
- return false
- end
- for i, v in pairs(PLAYER_HOLD) do
- if v.diff == L_DISTANCE then
- return v.plr
- end
- end
- return false
- end
- GUI_MAIN = Instance.new('ScreenGui', game.CoreGui)
- GUI_TARGET = Instance.new('TextLabel', GUI_MAIN)
- GUI_AIM_AT = Instance.new('TextLabel', GUI_MAIN)
- GUI_MAIN.Name = 'AIMBOT'
- GUI_TARGET.Size = UDim2.new(0,200,0,30)
- GUI_TARGET.BackgroundTransparency = 0.5
- GUI_TARGET.BackgroundColor = BrickColor.new('Fossil')
- GUI_TARGET.BorderSizePixel = 0
- GUI_TARGET.Position = UDim2.new(0.5,-100,0,0)
- GUI_TARGET.Text = 'AIMBOT : OFF'
- GUI_TARGET.TextColor3 = Color3.new(1,1,1)
- GUI_TARGET.TextStrokeTransparency = 1
- GUI_TARGET.TextWrapped = true
- GUI_TARGET.FontSize = 'Size24'
- GUI_TARGET.Font = 'SourceSansBold'
- GUI_AIM_AT.Size = UDim2.new(0,200,0,20)
- GUI_AIM_AT.BackgroundTransparency = 0.5
- GUI_AIM_AT.BackgroundColor = BrickColor.new('Fossil')
- GUI_AIM_AT.BorderSizePixel = 0
- GUI_AIM_AT.Position = UDim2.new(0.5,-100,0,30)
- GUI_AIM_AT.Text = 'AIMING : HEAD'
- GUI_AIM_AT.TextColor3 = Color3.new(1,1,1)
- GUI_AIM_AT.TextStrokeTransparency = 1
- GUI_AIM_AT.TextWrapped = true
- GUI_AIM_AT.FontSize = 'Size18'
- GUI_AIM_AT.Font = 'SourceSansBold'
- local TRACK = false
- MOUSE.KeyDown:connect(function(KEY)
- KEY = KEY:lower():byte()
- if KEY == _G.BIND then
- ENABLED = true
- end
- end)
- MOUSE.KeyUp:connect(function(KEY)
- KEY = KEY:lower():byte()
- if KEY == _G.BIND then
- ENABLED = false
- end
- end)
- MOUSE.KeyDown:connect(function(KEY)
- if KEY == _G.CHANGE_AIM then
- if _G.AIM_AT == 'Head' then
- _G.AIM_AT = 'Torso'
- GUI_AIM_AT.Text = 'AIMING : TORSO'
- elseif _G.AIM_AT == 'Torso' then
- _G.AIM_AT = 'Head'
- GUI_AIM_AT.Text = 'AIMING : HEAD'
- end
- end
- end)
- game:GetService('RunService').RenderStepped:connect(function()
- if ENABLED then
- local TARGET = GetNearestPlayerToMouse()
- if (TARGET ~= false) then
- local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
- if AIM then
- CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
- end
- GUI_TARGET.Text = 'AIMBOT : '.. TARGET.Name:sub(1, 5)
- else
- GUI_TARGET.Text = 'AIMBOT : OFF'
- end
- end
- end)
- wait()
- _G.FREE_FOR_ALL = true
- _G.BIND = 50 -- TAB
- function esp(plr)
- if plr then
- local char = plr.Character
- if not char then return end
- local head do
- repeat wait() until char:FindFirstChild("Head")
- end
- head = char.Head
- local bill = Instance.new("BillboardGui")
- bill.Adornee = head
- bill.ExtentsOffset = Vector3.new(0, 1, 0)
- bill.AlwaysOnTop = true
- bill.Size = UDim2.new(0, 5, 0, 5)
- bill.StudsOffset = Vector3.new(0, 3, 0)
- bill.Name = "ESP_PLAYER_" .. plr.Name
- bill.Parent = game:service'CoreGui'
- local frame = Instance.new("Frame")
- frame.ZIndex = 10
- frame.BackgroundTransparency = 1
- frame.Size = UDim2.new(1,0,1,0)
- frame.Parent = bill
- local name = Instance.new("TextLabel")
- name.Name = "Name"
- name.ZIndex = 10
- name.Text = plr.Name
- name.Visible = true
- name.TextColor3 = Color3.new(212,244,188)
- name.BackgroundTransparency = 1
- name.Size = UDim2.new(1,0,10,0)
- name.Font = Enum.Font.SourceSansLight
- name.TextSize = 20
- name.TextStrokeTransparency = .5
- name.Parent = frame
- end
- end
- for i,v in pairs(game:service'Players':GetChildren()) do
- if tostring(v.Team) == "Allied Airborne" then
- esp(v)
- v.CharacterAdded:Connect(function()
- wait(3)
- esp(v)
- end)
- end
- end
- while wait(5) do
- for i,v in pairs(game:service'Players':GetChildren()) do
- if not game:service'CoreGui':FindFirstChild("ESP_PLAYER_" .. v.Name) then
- if tostring(v.Team) == "Allied Airborne" then
- esp(v)
- v.CharacterAdded:Connect(function()
- wait(3)
- esp(v)
- end)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement