Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService('Players').LocalPlayer
- local haaa = false
- local mou = plr:GetMouse()
- local aimkey = "e"
- local toggle = true
- local teamkey = "q"
- local pathkey = "r"
- local wallkey = "t"
- local tk = false
- local path = false
- local nearmouse = false
- local pastpath = nil
- local editing = nil
- local walls = true
- local plrs = {}
- local tms = {}
- function sameteam(player,player2)
- local good = false
- if player.TeamColor == player2.TeamColor then
- good = true
- end
- return good
- end
- function distance(point1,point2,heck)
- local result = math.huge
- if nearmouse == false and (heck == false or heck == nil) then
- result = (point1-point2).magnitude
- else
- local hmm,eh = workspace.CurrentCamera:WorldToViewportPoint(point2)
- print((workspace.CurrentCamera.ViewportSize-Vector2.new(0,hmm.X,0,hmm.Y)).magnitude)
- return (workspace.CurrentCamera.ViewportSize-Vector2.new(0,hmm.X,0,hmm.Y)).magnitude
- end
- print(result)
- return result
- end
- ChangeToggle.MouseButton1Click:connect(function()
- if toggle == true then
- toggle = false
- ChangeToggle.Text = "Current: Holding"
- else
- toggle = true
- ChangeToggle.Text = "Current: Toggling"
- end
- end)
- ChangeSelection.MouseButton1Click:connect(function()
- if nearmouse == true then
- nearmouse = false
- ChangeSelection.Text = "Current: Closest To Player"
- else
- nearmouse = true
- ChangeSelection.Text = "Current: Closest To Center of Camera"
- end
- end)
- ChangeAim.MouseButton1Click:connect(function()
- if editing == nil then
- ChangeAim.Text = "Press any key to change."
- editing = "aim"
- end
- end)
- ChangeWall.MouseButton1Click:connect(function()
- if editing == nil then
- ChangeWall.Text = "Press any key to change."
- editing = "wall"
- end
- end)
- ChangePath.MouseButton1Click:connect(function()
- if editing == nil then
- ChangePath.Text = "Press any key to change."
- editing = "path"
- end
- end)
- ChangeTeam.MouseButton1Click:connect(function()
- if editing == nil then
- ChangeTeam.Text = "Press any key to change."
- editing = "team"
- end
- end)
- function cansee(targ)
- local cam = workspace.CurrentCamera
- local ray = Ray.new(plr.Character.Head.CFrame.p, (targ.CFrame.p - plr.Character.Head.CFrame.p).unit * 300)
- local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {plr.Character}, false, true)
- if part then
- local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
- if not humanoid then
- humanoid = part.Parent.Parent:FindFirstChildOfClass("Humanoid")
- end
- if humanoid and targ and humanoid.Parent == targ.Parent then
- local blah,actualthing = cam:WorldToScreenPoint(targ.Position)
- if actualthing == true then
- return true
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- end
- function getdatray(pointuno,pointdos)
- local ray = Ray.new(pointdos,(pointdos - pointuno).unit * 300)
- local distance = (pointuno - pointdos).magnitude
- local pos = CFrame.new(pointuno, pointdos) * CFrame.new(0, 0, -distance / 2)
- return distance,pos
- end
- mou.Button2Down:connect(function()
- if editing ~= nil then
- if editing == "aim" then
- aimkey = "RMB"
- if haaa then
- aimbot.Text = "Press RMB to toggle aimbot off."
- else
- aimbot.Text = "Press RMB to toggle aimbot on."
- end
- ChangeAim.Text = "Current: RMB"
- elseif editing == "team" then
- teamkey = "RMB"
- if tk then
- teamselect.Text = "Press RMB to toggle teamkill off."
- else
- teamselect.Text = "Press RMB to toggle teamkill on."
- end
- ChangeTeam.Text = "Current: RMB"
- elseif editing == "path" then
- pathkey = "RMB"
- if path then
- pathfind.Text = "Press RMB to toggle pathfinding off."
- else
- pathfind.Text = "Press RMB to toggle pathfinding on."
- end
- ChangePath.Text = "Current: RMB"
- elseif editing == "wall" then
- wallkey = "RMB"
- if walls then
- wallselect.Text = "Press RMB to toggle aiming through walls off."
- else
- wallselect.Text = "Press RMB to toggle aiming through walls on."
- end
- ChangeWall.Text = "Current: RMB"
- end
- editing = nil
- else
- if aimkey == "RMB" then
- if haaa and toggle == true then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot on."
- haaa = false
- elseif haaa == false then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot off."
- haaa = true
- end
- elseif teamkey == "RMB" then
- if tk then
- teamselect.Text = "Press "..string.upper(teamkey).." to toggle teamkill on."
- tk = false
- else
- teamselect.Text = "Press "..string.upper(teamkey).." to toggle teamkill off."
- tk = true
- end
- elseif pathkey == "RMB" then
- if path then
- pathfind.Text = "Press "..string.upper(pathkey).." to toggle pathfinding on."
- path = false
- else
- pathfind.Text = "Press "..string.upper(pathkey).." to toggle pathfinding off."
- path = true
- end
- elseif wallkey == "RMB" then
- if walls then
- walls = false
- wallselect.Text = "Press "..string.upper(wallkey).." to toggle aiming through walls on."
- else
- walls = true
- wallselect.Text = "Press "..string.upper(wallkey).." to toggle aiming through walls off."
- end
- end
- end
- end)
- mou.Button2Up:connect(function()
- if aimkey == "RMB" and toggle == false then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot on."
- haaa = false
- end
- end)
- mou.KeyDown:connect(function(key)
- if editing ~= nil then
- if editing == "aim" then
- aimkey = key
- if haaa then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot off."
- else
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot on."
- end
- ChangeAim.Text = "Current: "..string.upper(key)
- elseif editing == "team" then
- teamkey = key
- if tk then
- teamselect.Text = "Press "..string.upper(teamkey).." to toggle teamkill off."
- else
- teamselect.Text = "Press "..string.upper(teamkey).." to toggle teamkill on."
- end
- ChangeTeam.Text = "Current: "..string.upper(key)
- elseif editing == "path" then
- pathkey = key
- if path then
- pathfind.Text = "Press "..string.upper(pathkey).." to toggle pathfinding off."
- else
- pathfind.Text = "Press "..string.upper(pathkey).." to toggle pathfinding on."
- end
- ChangePath.Text = "Current: "..string.upper(key)
- elseif editing == "wall" then
- wallkey = key
- if walls then
- wallselect.Text = "Press "..string.upper(wallkey).." to toggle aiming through walls off."
- else
- wallselect.Text = "Press "..string.upper(wallkey).." to toggle aiming through walls on."
- end
- ChangeWall.Text = "Current: "..string.upper(key)
- end
- editing = nil
- elseif key == "p" then
- Chat.Enabled = not Chat.Enabled
- elseif key == "l" then
- ScreenGui.Enabled = not ScreenGui.Enabled
- elseif key == teamkey then
- if tk then
- teamselect.Text = "Press "..string.upper(teamkey).." to toggle teamkill on."
- tk = false
- else
- teamselect.Text = "Press "..string.upper(teamkey).." to toggle teamkill off."
- tk = true
- end
- elseif key == aimkey then
- if haaa and toggle == true then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot on."
- haaa = false
- elseif haaa == false then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot off."
- haaa = true
- end
- elseif key == pathkey then
- if path then
- pathfind.Text = "Press "..string.upper(pathkey).." to toggle pathfinding on."
- path = false
- else
- pathfind.Text = "Press "..string.upper(pathkey).." to toggle pathfinding off."
- path = true
- end
- elseif key == wallkey then
- if walls then
- walls = false
- wallselect.Text = "Press "..string.upper(wallkey).." to toggle aiming through walls on."
- else
- walls = true
- wallselect.Text = "Press "..string.upper(wallkey).." to toggle aiming through walls off."
- end
- end
- end)
- mou.KeyUp:connect(function(key)
- if key == aimkey and toggle == false then
- aimbot.Text = "Press "..string.upper(aimkey).." to toggle aimbot on."
- haaa = false
- end
- end)
- local thatthing = nil
- local Camera = workspace.CurrentCamera
- local bestdist = nil
- local setpart = "Head"
- local selectedpart = "Head"
- local canseenearest = false
- head.MouseButton1Click:connect(function()
- righta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- lefta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- rightl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- leftl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- torso.BackgroundColor3 = Color3.fromRGB(255,0,0)
- head.BackgroundColor3 = Color3.fromRGB(0,255,0)
- setpart = "Head"
- end)
- torso.MouseButton1Click:connect(function()
- righta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- lefta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- rightl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- leftl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- torso.BackgroundColor3 = Color3.fromRGB(0,255,0)
- head.BackgroundColor3 = Color3.fromRGB(255,0,0)
- setpart = "Torso"
- end)
- righta.MouseButton1Click:connect(function()
- righta.BackgroundColor3 = Color3.fromRGB(0,255,0)
- lefta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- rightl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- leftl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- torso.BackgroundColor3 = Color3.fromRGB(255,0,0)
- head.BackgroundColor3 = Color3.fromRGB(255,0,0)
- setpart = "Right Arm"
- end)
- lefta.MouseButton1Click:connect(function()
- righta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- lefta.BackgroundColor3 = Color3.fromRGB(0,255,0)
- rightl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- leftl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- torso.BackgroundColor3 = Color3.fromRGB(255,0,0)
- head.BackgroundColor3 = Color3.fromRGB(255,0,0)
- setpart = "Left Arm"
- end)
- rightl.MouseButton1Click:connect(function()
- righta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- lefta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- rightl.BackgroundColor3 = Color3.fromRGB(0,255,0)
- leftl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- torso.BackgroundColor3 = Color3.fromRGB(255,0,0)
- head.BackgroundColor3 = Color3.fromRGB(255,0,0)
- setpart = "Right Leg"
- end)
- leftl.MouseButton1Click:connect(function()
- righta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- lefta.BackgroundColor3 = Color3.fromRGB(255,0,0)
- rightl.BackgroundColor3 = Color3.fromRGB(255,0,0)
- leftl.BackgroundColor3 = Color3.fromRGB(0,255,0)
- torso.BackgroundColor3 = Color3.fromRGB(255,0,0)
- head.BackgroundColor3 = Color3.fromRGB(255,0,0)
- setpart = "Left Leg"
- end)
- local recentlyded = 0
- local lasttarg = nil
- game:GetService('RunService').Stepped:connect(function(time,thing)
- thatthing = nil
- canseenearest = false
- selectedpart = setpart
- Camera = workspace.CurrentCamera
- bestdist = nil
- if haaa or path then
- if walls == false then
- canseenearest = true
- end
- for i,v in pairs(game:GetService('Players'):GetChildren()) do
- if v ~= game:GetService('Players').LocalPlayer and v.Character and v.Character:FindFirstChild('Head') and v.Character:FindFirstChildOfClass('Humanoid') and v.Character:FindFirstChildOfClass('Humanoid').Health > 0 then
- if tk == false and (sameteam(v,plr) == false or game:GetService('Players').LocalPlayer.Team == nil) then
- if bestdist == nil or distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,v.Character.HumanoidRootPart.CFrame.p) < bestdist or (canseenearest == false and cansee(v.Character.Head)) then
- local gudguy = false
- for a,c in pairs(tms) do
- if v.TeamColor == c.TeamColor then
- gudguy = true
- end
- end
- for a,c in pairs(plrs) do
- if v == c then
- gudguy = true
- end
- end
- if gudguy == false then
- if canseenearest == true and cansee(v.Character.Head) then
- thatthing = v
- bestdist = distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,v.Character.HumanoidRootPart.CFrame.p)
- elseif canseenearest == false then
- if cansee(v.Character.Head) then
- canseenearest = true
- end
- thatthing = v
- bestdist = distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,v.Character.HumanoidRootPart.CFrame.p)
- end
- end
- end
- elseif tk == true then
- if bestdist == nil or distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,v.Character.HumanoidRootPart.CFrame.p) < bestdist or (canseenearest == false and cansee(v.Character.Head)) and (sameteam(v,plr) == false or game:GetService('Players').LocalPlayer.Team == nil) then
- local gudguy = false
- for a,c in pairs(plrs) do
- if v == c then
- gudguy = true
- end
- end
- for a,c in pairs(tms) do
- if v.TeamColor == c.TeamColor then
- gudguy = true
- end
- end
- if gudguy == false then
- if canseenearest == true and cansee(v.Character.Head) then
- thatthing = v
- bestdist = distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,v.Character.HumanoidRootPart.CFrame.p)
- elseif canseenearest == false then
- if cansee(v.Character.Head) then
- canseenearest = true
- end
- thatthing = v
- bestdist = distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,v.Character.HumanoidRootPart.CFrame.p)
- end
- end
- end
- end
- end
- end
- if thatthing ~= nil and bestdist ~= nil and plr.Character:FindFirstChild('HumanoidRootPart') and thatthing.Character:FindFirstChild('HumanoidRootPart') then
- if haaa then
- if selectedpart == "Right Arm" then
- if thatthing.Character:FindFirstChild('Right Arm') == nil then
- if thatthing.Character:FindFirstChild('RightLowerArm') then
- selectedpart = "RightLowerArm"
- else
- selectedpart = "Head"
- end
- end
- elseif selectedpart == "Left Arm" then
- if thatthing.Character:FindFirstChild('Left Arm') == nil then
- if thatthing.Character:FindFirstChild('LeftLowerArm') then
- selectedpart = "LeftLowerArm"
- else
- selectedpart = "Head"
- end
- end
- elseif selectedpart == "Left Leg" then
- if thatthing.Character:FindFirstChild('Left Leg') == nil then
- if thatthing.Character:FindFirstChild('LeftLowerLeg') then
- selectedpart = "LeftLowerLeg"
- else
- selectedpart = "Head"
- end
- end
- elseif selectedpart == "Right Leg" then
- if thatthing.Character:FindFirstChild('Right Leg') == nil then
- if thatthing.Character:FindFirstChild('RightLowerLeg') then
- selectedpart = "RightLowerLeg"
- else
- selectedpart = "Head"
- end
- end
- elseif selectedpart == "Torso" then
- if thatthing.Character:FindFirstChild('Torso') == nil then
- if thatthing.Character:FindFirstChild('UpperTorso') then
- selectedpart = "UpperTorso"
- else
- selectedpart = "Head"
- end
- end
- end
- local good = true
- if lasttarg and lasttarg:FindFirstChildOfClass('Humanoid') and lasttarg:FindFirstChildOfClass('Humanoid').Health <= 0 then
- recentlyded = 20
- lasttarg = nil
- end
- if recentlyded > 0 then
- good = false
- recentlyded = recentlyded - 1
- else
- good = true
- end
- if thatthing and thatthing.Character and Camera and good then
- lasttarg = thatthing.Character
- end
- if distance(game:GetService('Players').LocalPlayer.Character.HumanoidRootPart.CFrame.p,thatthing.Character[selectedpart].CFrame.p,true) > 1029 then
- for i=1,7 do
- if thatthing and thatthing.Character and Camera and good == true then
- Camera.CFrame = Camera.CFrame:lerp(CFrame.new(Camera.CFrame.p,thatthing.Character[selectedpart].CFrame.p),i/5)
- end
- wait()
- end
- else
- Camera.CFrame = CFrame.new(Camera.CFrame.p,thatthing.Character[selectedpart].CFrame.p)
- end
- end
- end
- end
- end)
- game:GetService('Players').PlayerRemoving:connect(function(pla)
- for i,v in pairs(plrs) do
- if v == pla then
- table.remove(plrs,i)
- end
- end
- end)
- game:GetService('Teams').ChildRemoved:connect(function(child)
- for i,v in pairs(tms) do
- if v == child then
- table.remove(tms,i)
- end
- end
- end)
- while true do
- for i,v in pairs(workspace.CurrentCamera:GetChildren()) do
- if v.Name == "PATH BOI" then
- v:Destroy()
- end
- end
- for i,v in pairs(players:GetChildren()) do
- v:Destroy()
- end
- for i,v in pairs(teams:GetChildren()) do
- v:Destroy()
- end
- local thatnum = 0
- for i,v in pairs(game:GetService('Teams'):GetChildren()) do
- if v.TeamColor ~= game:GetService('Players').LocalPlayer.TeamColor then
- local team = Instance.new('TextButton',teams)
- if thatnum > 4 then
- teams.CanvasSize = UDim2.new(0,0,0,(thatnum*(teams.AbsoluteSize.Y/5))+(teams.AbsoluteSize.Y/5))
- else
- teams.CanvasSize = UDim2.new(0,0,0,0)
- end
- team.Name = v.Name
- team.TextScaled = true
- team.Text = v.Name
- team.Size = UDim2.new(1,0,0,teams.AbsoluteSize.Y/5)
- team.Position = UDim2.new(0,0,0,(thatnum*(teams.AbsoluteSize.Y/5)))
- team.BackgroundTransparency = 1
- team.TextColor3 = Color3.new(1,0,0)
- for c,a in pairs(tms) do
- if a == v then
- team.TextColor3 = Color3.new(0,1,0)
- end
- end
- team.MouseButton1Click:connect(function()
- local found = false
- for c,a in pairs(tms) do
- if a == v then
- table.remove(tms,c)
- found = true
- team.TextColor3 = Color3.new(1,0,0)
- end
- end
- if found == false then
- table.insert(tms,v)
- team.TextColor3 = Color3.new(0,1,0)
- end
- end)
- thatnum = thatnum+1
- end
- end
- local thatnum2 = 0
- for i,v in pairs(game:GetService('Players'):GetChildren()) do
- if v ~= game:GetService('Players').LocalPlayer then
- local team = Instance.new('TextButton',players)
- if thatnum2 > 4 then
- players.CanvasSize = UDim2.new(0,0,0,(thatnum2*(players.AbsoluteSize.Y/5))+(players.AbsoluteSize.Y/5))
- else
- players.CanvasSize = UDim2.new(0,0,0,0)
- end
- team.Name = v.Name
- team.TextScaled = true
- team.Text = v.Name
- team.Size = UDim2.new(1,0,0,players.AbsoluteSize.Y/5)
- team.Position = UDim2.new(0,0,0,(thatnum2*(players.AbsoluteSize.Y/5)))
- team.BackgroundTransparency = 1
- team.TextColor3 = Color3.new(1,0,0)
- for c,a in pairs(plrs) do
- if a == v then
- team.TextColor3 = Color3.new(0,1,0)
- end
- end
- team.MouseButton1Click:connect(function()
- local found = false
- for c,a in pairs(plrs) do
- if a == v then
- table.remove(plrs,c)
- found = true
- team.TextColor3 = Color3.new(1,0,0)
- end
- end
- if found == false then
- table.insert(plrs,v)
- team.TextColor3 = Color3.new(0,1,0)
- end
- end)
- thatnum2 = thatnum2+1
- end
- end
- if path then
- if plr.Character and plr.Character:FindFirstChild('HumanoidRootPart') and thatthing and thatthing.Character and thatthing.Character:FindFirstChild('HumanoidRootPart') then
- local pat = game:GetService('PathfindingService'):ComputeSmoothPathAsync(plr.Character.HumanoidRootPart.Position,thatthing.Character.HumanoidRootPart.Position,512)
- if pat.Status == Enum.PathStatus.Success or pat.Status == Enum.PathStatus.ClosestOutOfRange then
- local pa = pat:GetPointCoordinates()
- local fol = Instance.new('Folder',workspace.CurrentCamera)
- fol.Name = "PATH BOI"
- local first = nil
- for i,v in pairs(pa) do
- if first ~= nil then
- local pathfindpart = Instance.new('Part',fol)
- local dist,place = getdatray(first,v)
- pathfindpart.BrickColor = BrickColor.new('Really red')
- pathfindpart.Size = Vector3.new(0.2,0.2,dist)
- pathfindpart.Transparency = 0.5
- pathfindpart.Material = Enum.Material.Neon
- pathfindpart.Anchored = true
- pathfindpart.CanCollide = false
- pathfindpart.CFrame = place
- end
- first = v
- end
- end
- end
- end
- wait(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement