Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1. print("Key to toggle esp is V.")
  2. print("Aim-key is Left-Alt.")
  3.  
  4. ENABLED = false
  5. PLAYER = game.Players.LocalPlayer
  6. MOUSE = PLAYER:GetMouse()
  7. CC = game.Workspace.CurrentCamera
  8. _G.FREE_FOR_ALL = true
  9. _G.BIND = 52
  10. _G.AIM_AT = 'Torso'
  11. local player = game.Players.LocalPlayer
  12. local esp = false
  13. local track = false
  14.  
  15.  
  16.  
  17. function Create(base, team)
  18. local bb = Instance.new("BillboardGui",player.PlayerGui)
  19. bb.Adornee = base
  20. bb.ExtentsOffset = Vector3.new(0,1,0)
  21. bb.AlwaysOnTop = true
  22. bb.Size = UDim2.new(0,5,0,5)
  23. bb.StudsOffset = Vector3.new(0,1,0)
  24. bb.Name = "tracker"
  25. local frame = Instance.new("Frame",bb)
  26. frame.ZIndex = 10
  27. frame.BackgroundTransparency = 0.3
  28. frame.Size = UDim2.new(1,0,1,0)
  29. frame.Position = UDim2.new(0,0,0)
  30. frame.Transparency = 1
  31. local txtlbl = Instance.new("TextLabel",bb)
  32. txtlbl.ZIndex = 10
  33. txtlbl.Text = (string.upper(base.Parent.Name))
  34. txtlbl.BackgroundTransparency = 1
  35. txtlbl.Position = UDim2.new(0,0,0,-35)
  36. txtlbl.Size = UDim2.new(1,0,10,0)
  37. txtlbl.Font = "SourceSansBold"
  38. txtlbl.FontSize = "Size10"
  39. txtlbl.TextStrokeTransparency = 0.5
  40.  
  41. local txtlbl2 = Instance.new("TextLabel",bb)
  42. txtlbl2.ZIndex = 10
  43. txtlbl2.Text = (math.floor(base.Parent.Humanoid.Health*100)/100)
  44. txtlbl2.BackgroundTransparency = 1
  45. txtlbl2.Position = UDim2.new(0,0,0,-25)
  46. txtlbl2.Size = UDim2.new(1,0,10,0)
  47. txtlbl2.Font = "SourceSansBold"
  48. txtlbl2.FontSize = "Size10"
  49.  
  50. txtlbl2.TextStrokeTransparency = 0.5
  51. if team then
  52. txtlbl.TextColor3 = Color3.new(0,255,0)
  53. txtlbl2.TextColor3 = Color3.new(255,0,0)
  54. frame.BackgroundColor3 = Color3.new(255,0,0)
  55.  
  56. elseif base.Parent.Name == "whielist kid" or base.Parent.Name == "second whitelist kid here" then
  57. txtlbl.TextColor3 = Color3.new(0,255,0)
  58. txtlbl2.TextColor3 = Color3.new(0,255,0)
  59. frame.BackgroundColor3 = Color3.new(0,255,0)
  60. txtlbl.Text = "FRIEND"
  61. txtlbl.FontSize = "Size14"
  62. txtlbl2.FontSize = "Size14"
  63.  
  64.  
  65.  
  66. elseif base.Parent.Name == game.Players.LocalPlayer.Name then
  67. txtlbl2.Transparency = 1
  68. txtlbl.Transparency = 1
  69. frame.Transparency = 1
  70. else
  71. txtlbl.TextColor3 = Color3.new(255,0,0)
  72. txtlbl2.TextColor3 = Color3.new(255,0,0)
  73. frame.BackgroundColor3 = Color3.new(255,0,0)
  74.  
  75. end
  76. end
  77.  
  78.  
  79. function Find()
  80. Clear()
  81. track = true
  82. spawn(function()
  83. while wait() do
  84. if track then
  85. Clear()
  86. for _,v in pairs(game.Players:players()) do
  87.  
  88. if v.Character and v.Character.Torso then
  89. Create(v.Character.Torso, false)
  90. end
  91. end
  92. end
  93. end
  94. wait(1)
  95. end)
  96. end
  97. function Clear()
  98. for _,v in pairs(player.PlayerGui:children()) do
  99. if v.Name == "tracker" and v:isA("BillboardGui") then
  100. v:Destroy()
  101. end
  102. end
  103. end
  104. mouse=game.Players.LocalPlayer:GetMouse()
  105. mouse.keyDown:connect(function(key)
  106. if key == "v" then
  107. if not esp then
  108. Find()
  109. print("ESP ENABLED")
  110. esp = true
  111. else
  112. Clear()
  113. track = false
  114. print("ESP DISABLED")
  115. esp = false
  116. end
  117.  
  118.  
  119.  
  120.  
  121. end
  122.  
  123. end)
  124.  
  125.  
  126.  
  127. --aimbot
  128.  
  129.  
  130. function GetNearestPlayerToMouse()
  131. local PLAYERS = {}
  132. local PLAYER_HOLD = {}
  133. local DISTANCES = {}
  134. for i, v in pairs(game.Players:GetPlayers()) do
  135. if v ~= PLAYER then
  136. table.insert(PLAYERS, v)
  137. end
  138. end
  139. for i, v in pairs(PLAYERS) do
  140. if _G.FREE_FOR_ALL == false then
  141. if v and (v.Character) ~= nil and v.TeamColor ~= PLAYER.TeamColor then
  142. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  143. if AIM ~= nil then
  144. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  145. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  146. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  147. local DIFF = math.floor((POS - AIM.Position).magnitude)
  148. PLAYER_HOLD[v.Name .. i] = {}
  149. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  150. PLAYER_HOLD[v.Name .. i].plr = v
  151. PLAYER_HOLD[v.Name .. i].diff = DIFF
  152. table.insert(DISTANCES, DIFF)
  153. end
  154. end
  155. elseif _G.FREE_FOR_ALL == true then
  156. local AIM = v.Character:FindFirstChild(_G.AIM_AT)
  157. if AIM ~= nil then
  158. local DISTANCE = (AIM.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  159. local RAY = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p, (MOUSE.Hit.p - CC.CoordinateFrame.p).unit * DISTANCE)
  160. local HIT,POS = game.Workspace:FindPartOnRay(RAY, game.Workspace)
  161. local DIFF = math.floor((POS - AIM.Position).magnitude)
  162. PLAYER_HOLD[v.Name .. i] = {}
  163. PLAYER_HOLD[v.Name .. i].dist = DISTANCE
  164. PLAYER_HOLD[v.Name .. i].plr = v
  165. PLAYER_HOLD[v.Name .. i].diff = DIFF
  166. table.insert(DISTANCES, DIFF)
  167. end
  168. end
  169. end
  170.  
  171. if unpack(DISTANCES) == nil then
  172. return false
  173. end
  174.  
  175. local L_DISTANCE = math.floor(math.min(unpack(DISTANCES)))
  176. if L_DISTANCE > 20 then
  177. return false
  178. end
  179.  
  180. for i, v in pairs(PLAYER_HOLD) do
  181. if v.diff == L_DISTANCE then
  182. return v.plr
  183. end
  184. end
  185. return false
  186. end
  187.  
  188. local TRACK = false
  189.  
  190.  
  191. MOUSE.KeyDown:connect(function(KEY)
  192. KEY = KEY:lower():byte()
  193. if KEY == _G.BIND then
  194. ENABLED = true
  195. end
  196. end)
  197. MOUSE.KeyUp:connect(function(KEY)
  198. KEY = KEY:lower():byte()
  199. if KEY == _G.BIND then
  200. ENABLED = false
  201. end
  202. end)
  203.  
  204. game:GetService('RunService').RenderStepped:connect(function()
  205. if ENABLED then
  206. local TARGET = GetNearestPlayerToMouse()
  207. if TARGET.Name == "AM0M" or TARGET.Name == "Centrax" then
  208. else
  209.  
  210. if (TARGET ~= false) then
  211. local AIM = TARGET.Character:FindFirstChild(_G.AIM_AT)
  212. if AIM then
  213. CC.CoordinateFrame = CFrame.new(CC.CoordinateFrame.p, AIM.CFrame.p)
  214. end
  215. end
  216. end
  217. end
  218. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement