Burkino

PF Veil Aimbot

Feb 18th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.75 KB | None | 0 0
  1. local plr = game:service'Players'.LocalPlayer
  2. local pgui = plr.PlayerGui
  3. pcall(function() pgui.aimbot:Destroy() end)
  4.  
  5. ESP = true --Do you want ESP?
  6. Aimbot = true --Do you want Aimbot?
  7. IgnoreWalls = true --Do you want to shoot through walls?
  8. _G.Legit = true --Do you always want to shoot headshots?
  9.  
  10. Sniper = {"INTERVENTION", "REMINGTON 700", "AWS", "L115A3", "MOSIN NAGANT", "OBREZ"}
  11. SpecialSniper = {"BFG 50", "SFG 50"}
  12. WeakSniper = {"MK11", "SKS", "SCAR SSR", "DRAGUNOV SVU", "HENRY 45-70"}
  13. SMG = {"SCAR-H", "AG-3", "M4A1", "G36C", "M4", "L22", "SCAR PDW", "SR-3M", "P90", "AUG A3 PARA", "AK12", "AN-94", "AS VAL", "SCAR-L", "AUG A1", "M16A4", "G36", "M16A3", "AUG A2", "FAMAS", "AK44", "AUG A3", "L85A2", "HONEY BADGER", "AK74", "AKM", "M231"}
  14. WeakSMG = {"MP5K", "UMP45", "MP7", "MAC10", "MP5", "COLT SMG 635", "MP5SD", "MP10", "MP5/10", "KRISS VECTOR"}
  15. ShotGun = {"REMINGTON 870", "KSG 12", "KS-23M", "SERBU SHOTGUN"}
  16. LMG = {"COLT LMG", "M60", "AUG HBAR", "MG36", "L86 LSW", "RPK", "SCAR HAMR", "RPK74"}
  17. Other = {"M9", "GLOCK 17", "M1911", "DEAGLE 44", "GLOCK 18", "M93R", "TEC9", "MP412 REX"}
  18. Melee = {"KNIFE", "MACHETE"}
  19.  
  20. warn("Version: 1.0.0, Welcome To Project Bear's ESP, Report bugs to the Project Bear Discord.")
  21.  
  22.  
  23. local camera = workspace.CurrentCamera
  24. local ScreenX, ScreenY = workspace.CurrentCamera.ViewportSize.X, workspace.CurrentCamera.ViewportSize.Y
  25. local inversePi = 1 / math.pi
  26. _G.FOV = 30
  27. local magic = _G.FOV*inversePi
  28. _G.ignoreFOV = false
  29. local aim_through_list = {nil, nil, nil}
  30. local distance
  31. local ignore
  32. local distance2
  33. Pixels = ScreenX * ScreenY
  34. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  35. Radius = math.sqrt(Pixels*magic)
  36. local viable
  37. local your_head = game:GetService("Players").LocalPlayer.Character:FindFirstChild("Head")
  38. local ray_start
  39. local vector
  40. _G.ignoreWalls = true
  41. _G.ShootingTeam = false
  42. local enabled = false
  43. local target
  44.  
  45.  
  46. local function ReturnF(player, bone)
  47. if not bone and player.Character:FindFirstChild(bone) then
  48. return {_, false}
  49. end
  50. return camera:WorldToScreenPoint(player.Character[bone].Position)
  51. end
  52. local function checksight(player)
  53. local screen_position, in_fov = ReturnF(player, "Head") -- end my life
  54. if not (in_fov or _G.ignoreFOV) then
  55. return false
  56. else -- bug here with fov checks
  57. if (not _G.ignoreFOV) and (_G.FOV~=-1) then
  58. local distance2 = (Vector2.new(screen_position.X, screen_position.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  59. if distance2<=Radius then
  60. return player, screen_position
  61. end
  62. return false
  63. else
  64. return player, screen_position
  65. end
  66. end
  67. end
  68.  
  69.  
  70. local function ViableP()
  71. aim_through_list[1] = game:GetService("Players").LocalPlayer.Character
  72. local distance = 1000
  73. local closest_distance = 1000
  74. local most_viable_player = nil
  75. for i, player_being_checked in pairs(game:GetService("Players"):GetPlayers()) do
  76. local player_or_false, targets_coordinates = checksight(player_being_checked)
  77. if (player_or_false) then
  78. local char = player_being_checked.Character
  79. local target_torso = char and char:FindFirstChild "Torso"
  80. if (camera.Focus.p - camera.CoordinateFrame.p).magnitude <= 1 then
  81. ray_start = your_head.Position + your_head.CFrame.lookVector * 16 + Vector3.new(0, 4, 0)
  82. else
  83. ray_start = your_head.Position + Vector3.new(0, 4, 0)
  84. end
  85. if not targets_coordinates then
  86. distance = (Vector2.new(targets_coordinates.X, targets_coordinates.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  87. else
  88. distance = (Vector2.new(targets_coordinates.X, targets_coordinates.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  89. end
  90. vector = (target_torso.Position - ray_start)
  91. if char:FindFirstChild("Head") then
  92. if (not targets_coordinates) or (distance <= closest_distance) then
  93. local new_ray = Ray.new(ray_start, vector.unit * 1000) -- "fire" ray and make sure to ignore our own character
  94. local hit, position = workspace:FindPartOnRayWithIgnoreList(new_ray, aim_through_list) -- check if the ray hit anything and if it's a descendant of the target's character
  95. if (hit and hit:isDescendantOf(char)) or _G.ignoreWalls then
  96. if char.HumanoidRootPart:FindFirstChild("ESP") then
  97. if char.HumanoidRootPart.ESP.Frame.BackgroundColor3 == Color3.new(1, 0.666667, 0) or char.HumanoidRootPart.ESP.Frame.BackgroundColor3 == Color3.new(0, 1, 0.498039) then
  98. closest_distance = distance
  99. most_viable_player = player_being_checked
  100. target = player_being_checked
  101. else
  102. if IgnoreWalls == false then
  103. most_viable_player = nil
  104. target = nil
  105. elseif IgnoreWalls == true then
  106. closest_distance = distance
  107. most_viable_player = player_being_checked
  108. target = player_being_checked
  109.  
  110. end
  111. end
  112. else
  113.  
  114. if IgnoreWalls == false then
  115. most_viable_player = nil
  116. target = nil
  117. elseif IgnoreWalls == true then
  118. closest_distance = distance
  119. most_viable_player = player_being_checked
  120. target = player_being_checked
  121.  
  122. end
  123.  
  124. end
  125. else
  126. most_viable_player = nil
  127. target = nil
  128. end -- hit or ignore walls
  129. end -- meets distance or no priority
  130. end
  131. end
  132. end
  133. return most_viable_player
  134. end
  135.  
  136.  
  137.  
  138.  
  139.  
  140. game:GetService("RunService").Heartbeat:connect(function()
  141.  
  142.  
  143.  
  144.  
  145.  
  146. if Aimbot == true then
  147. ViableP()
  148. workspace.DeadBody:ClearAllChildren()
  149. wep = nil
  150. for i,v in pairs(workspace.Camera:GetChildren()) do
  151. if v:FindFirstChild("Flame") then
  152. wep = v
  153. break
  154. end
  155. end
  156. if wep and target ~= nil then
  157. if target.TeamColor ~= game:GetService("Players").LocalPlayer.TeamColor then
  158. wep.Flame.Size = Vector3.new(1,5,1)
  159. wep.Flame.Anchored = true
  160. if target.Character:FindFirstChild("Head") then
  161. if _G.Legit == false then
  162. wep.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,1.9) -- this is where the magic is
  163. elseif _G.Legit == true then
  164. wep = false
  165. Type = nil
  166.  
  167. Current = nil
  168. for i,v in pairs(workspace.CurrentCamera:GetChildren()) do
  169. if v.Name ~= "Right Arm" and v.Name ~= "Left Arm" then
  170. if v:IsA("Model") then
  171. if v:FindFirstChild("Flame") then
  172. Current = v
  173. break
  174. end
  175. end
  176. end
  177. end
  178.  
  179. if wep == false then
  180. for i = 1,#LMG do
  181. if Current ~= nil then
  182. if LMG[i] == Current.Name then
  183. wep = true
  184. Type = "LMG"
  185. break
  186. end
  187. end
  188. end
  189. end
  190.  
  191. if wep == false then
  192. for i = 1,#SMG do
  193. if Current ~= nil then
  194. if SMG[i] == Current.Name then
  195. wep = true
  196. Type = "SMG"
  197. break
  198. end
  199. end
  200. end
  201. end
  202.  
  203. if wep == false then
  204. for i = 1,#WeakSMG do
  205. if Current ~= nil then
  206. if WeakSMG[i] == Current.Name then
  207. wep = true
  208. Type = "WeakSMG"
  209. break
  210. end
  211. end
  212. end
  213. end
  214.  
  215. if wep == false then
  216. for i = 1,#Other do
  217. if Current ~= nil then
  218. if Other[i] == Current.Name then
  219. wep = true
  220. Type = "Other"
  221. break
  222. end
  223. end
  224. end
  225. end
  226.  
  227. if wep == false then
  228. for i = 1,#ShotGun do
  229. if Current ~= nil then
  230. if ShotGun[i] == Current.Name then
  231. wep = true
  232. Type = "ShotGun"
  233. break
  234. end
  235. end
  236. end
  237. end
  238. if Type == nil then
  239. random = math.random(1,3)
  240. if random == 1 then
  241. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  242. end
  243. if random >= 2 and random <= 3 then
  244. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  245. end
  246. elseif Type == "LMG" then
  247. if ((game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - target.Character.HumanoidRootPart.Position).magnitude) <= 150 then
  248. random = math.random(1,6)
  249. if random == 1 then
  250. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  251. end
  252. if random >= 2 and random <= 3 then
  253. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  254. end
  255. if random >= 4 and random <= 6 then
  256. Current.Flame.CFrame = CFrame.new(0,0,0)
  257. end
  258. else
  259. random = math.random(1,10)
  260. if random == 1 then
  261. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  262. end
  263. if random >= 2 and random <= 3 then
  264. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  265. end
  266. if random >= 4 and random <= 10 then
  267. Current.Flame.CFrame = CFrame.new(0,0,0)
  268. end
  269.  
  270. end
  271. elseif Type == "ShotGun" then
  272. random = math.random(1,5)
  273. if random == 1 then
  274. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  275. end
  276. if random >= 2 and random <= 3 then
  277. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  278. end
  279. if random >= 4 and random <= 5 then
  280. Current.Flame.CFrame = CFrame.new(0,0,0)
  281. end
  282. elseif Type == "WeakSMG" or Type == "SMG" then
  283. if ((game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - target.Character.HumanoidRootPart.Position).magnitude) <= 125 then
  284. random = math.random(1,6)
  285. if random == 1 then
  286. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  287. end
  288. if random >= 2 and random <= 3 then
  289. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  290. end
  291. if random >= 4 and random <= 6 then
  292. Current.Flame.CFrame = CFrame.new(0,0,0)
  293. end
  294. else
  295. random = math.random(1,8)
  296. if random == 1 then
  297. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  298. end
  299. if random >= 2 and random <= 3 then
  300. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  301. end
  302. if random >= 4 and random <= 8 then
  303. Current.Flame.CFrame = CFrame.new(0,0,0)
  304. end
  305.  
  306. end
  307. elseif Type == "Other" then
  308. random = math.random(1,6)
  309. if random == 1 then
  310. Current.Flame.CFrame = target.Character.Head.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  311. end
  312. if random >= 2 and random <= 4 then
  313. Current.Flame.CFrame = target.Character.Torso.CFrame*CFrame.new(0,0,0.1) -- this is where the magic is
  314. end
  315. if random >= 5 and random <= 6 then
  316. Current.Flame.CFrame = CFrame.new(0,0,0)
  317. end
  318. end
  319. end
  320. end
  321. end
  322. end
  323. end
  324.  
  325.  
  326.  
  327.  
  328.  
  329. if ESP == true then
  330. for i,v in pairs(game:GetService("Players"):GetChildren()) do
  331. pass = false
  332. if workspace:FindFirstChild(v.Name) then
  333. if v.Team == game:GetService("Players").LocalPlayer.Team then
  334. if v.Character:FindFirstChild("HumanoidRootPart") then
  335. if v.Character.HumanoidRootPart:FindFirstChild("ESP") then
  336. v.Character.HumanoidRootPart.ESP:Destroy()
  337. end
  338. end
  339. end
  340. if v.Team ~= game:GetService("Players").LocalPlayer.Team then
  341. if v.Character:FindFirstChild("HumanoidRootPart") then
  342. for i,v in pairs(v.Character:GetChildren()) do
  343. if v:IsA("Model") then
  344. pass = true
  345. break
  346. end
  347. end
  348.  
  349. shirt = nil
  350. passer = false
  351. for i,v in pairs(v.Character:GetChildren()) do
  352. if v:IsA("Shirt") then
  353. shirt = v
  354. break
  355. end
  356. end
  357.  
  358. for i,v in pairs(game:GetService("Players").LocalPlayer.Character:GetChildren()) do
  359. if v:IsA("Shirt") then
  360. if shirt ~= nil then
  361. if v.Name ~= shirt.Name then
  362. passer = true
  363. break
  364. end
  365. end
  366. end
  367. end
  368.  
  369. if passer == true then
  370. if v.Character:FindFirstChild("HumanoidRootPart") then
  371. if v.Character.HumanoidRootPart:FindFirstChild("ESP") then
  372.  
  373. v.Character.HumanoidRootPart.ESP.TextLabel.Text = v.Name.." Distance: "..math.floor(((game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).magnitude))
  374.  
  375. hitting = false
  376.  
  377.  
  378. local ray = Ray.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame.p, (v.Character.HumanoidRootPart.CFrame.p - game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame.p).unit * 2000)
  379. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {game:GetService("Players").LocalPlayer.Character, workspace.CurrentCamera, workspace.Ignore}, false, true)
  380. if part then
  381. if part.Parent == v.Character then
  382. hitting = true
  383. end
  384. end
  385. if hitting == false then
  386. elseif hitting == true then
  387. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(0, 1, 0.498039)
  388. end
  389.  
  390. if hitting == false then
  391. local ray = Ray.new(game:GetService("Players").LocalPlayer.Character.Head.CFrame.p, (v.Character.Head.CFrame.p - game:GetService("Players").LocalPlayer.Character.Head.CFrame.p).unit * 2000)
  392. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {game:GetService("Players").LocalPlayer.Character, workspace.CurrentCamera, workspace.Ignore}, false, true)
  393. if part then
  394. if part.Parent == v.Character then
  395. hitting = true
  396. end
  397. end
  398. if hitting == false then
  399. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  400. elseif hitting == true then
  401. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(0, 1, 0.498039)
  402. end
  403.  
  404. if hitting == false then
  405. elseif hitting == true then
  406. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(0, 1, 0.498039)
  407. end
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419. if hitting == false then
  420. local ray = Ray.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame.p, (v.Character.HumanoidRootPart.CFrame.p - game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame.p).unit * 2000)
  421. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {game:GetService("Players").LocalPlayer.Character, workspace.CurrentCamera, workspace.Ignore}, false, true)
  422. if part then
  423. if part:IsA("BasePart") then
  424.  
  425. CurrentGun = nil
  426. for i,v in pairs(workspace.CurrentCamera:GetChildren()) do
  427. if v.Name ~= "Right Arm" and v.Name ~= "Left Arm" then
  428. if v:IsA("Model") then
  429. if v:FindFirstChild("Flame") then
  430. CurrentGun = v
  431. break
  432. end
  433. end
  434. end
  435. end
  436.  
  437. found = false
  438.  
  439. if found == false then
  440. for i = 1,#Sniper do
  441. if CurrentGun ~= nil then
  442. if Sniper[i] == CurrentGun.Name then
  443. found = true
  444. Min = 2.75
  445. Max = 3
  446. break
  447. end
  448. end
  449. end
  450. end
  451.  
  452. if found == false then
  453. for i = 1,#SpecialSniper do
  454. if CurrentGun ~= nil then
  455. if SpecialSniper[i] == CurrentGun.Name then
  456. found = true
  457. Min = 3.25
  458. Max = 3.5
  459. break
  460. end
  461. end
  462. end
  463. end
  464.  
  465. if found == false then
  466. for i = 1,#WeakSniper do
  467. if CurrentGun ~= nil then
  468. if WeakSniper[i] == CurrentGun.Name then
  469. found = true
  470. Min = 2.75
  471. Max = 3
  472. break
  473. end
  474. end
  475. end
  476. end
  477.  
  478. if found == false then
  479. for i = 1,#WeakSMG do
  480. if CurrentGun ~= nil then
  481. if WeakSMG[i] == CurrentGun.Name then
  482. found = true
  483. Min = 2.25
  484. Max = 3
  485. break
  486. end
  487. end
  488. end
  489. end
  490.  
  491. if found == false then
  492. for i = 1,#SMG do
  493. if CurrentGun ~= nil then
  494. if SMG[i] == CurrentGun.Name then
  495. found = true
  496. Min = 2.5
  497. Max = 3
  498. break
  499. end
  500. end
  501. end
  502. end
  503.  
  504. if found == false then
  505. for i = 1,#ShotGun do
  506. if CurrentGun ~= nil then
  507. if ShotGun[i] == CurrentGun.Name then
  508. found = true
  509. Min = 2.75
  510. Max = 3
  511. break
  512. end
  513. end
  514. end
  515. end
  516.  
  517. if found == false then
  518. for i = 1,#LMG do
  519. if CurrentGun ~= nil then
  520. if LMG[i] == CurrentGun.Name then
  521. found = true
  522. Min = 2.5
  523. Max = 3
  524. break
  525. end
  526. end
  527. end
  528. end
  529.  
  530. if found == false then
  531. for i = 1,#Other do
  532. if CurrentGun ~= nil then
  533. if Other[i] == CurrentGun.Name then
  534. found = true
  535. Min = 0
  536. Max = 0
  537. break
  538. end
  539. end
  540. end
  541. end
  542.  
  543. if found == false then
  544. for i = 1,#Melee do
  545. if CurrentGun ~= nil then
  546. if Melee[i] == CurrentGun.Name then
  547. found = true
  548. Min = 0
  549. Max = 0
  550. break
  551. end
  552. end
  553. end
  554. end
  555.  
  556. if found == false then
  557. Min = 0
  558. Max = 0
  559. end
  560.  
  561. if part.Parent.Name == "Map" then
  562. if part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  563. hitting = true
  564. parter = part
  565. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y >= Max then
  566. hitting = true
  567. parter = part
  568. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y <= Min then
  569. hitting = true
  570. parter = part
  571. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Min then
  572. hitting = true
  573. parter = part
  574. elseif part.Size.X <= Min and part.Size.Z >= Min and part.Size.Y <= Min then
  575. hitting = true
  576. parter = part
  577. elseif part.Size.X >= Max and part.Size.Z <= Min and part.Size.Y <= Min then
  578. hitting = true
  579. parter = part
  580. elseif part.Size.X >= Max and part.Size.Z >= Max and part.Size.Y <= Min-1 then
  581. hitting = true
  582. parter = part
  583. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Max then
  584. hitting = true
  585. parter = part
  586. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  587. hitting = true
  588. parter = part
  589. elseif part.Size.X <= Min or part.Size.Z <= Min or part.Size.Z <= Min then
  590. hitting = true
  591. parter = part
  592. end
  593. end
  594. end
  595. end
  596. if hitting == true then
  597. hitting = false
  598. part = parter
  599. list = {}
  600. pos1 = part.Position - (part.Size/2) - Vector3.new(0.01,0.01,0.01)
  601. pos2 = part.Position + (part.Size/2) + Vector3.new(0.01,0.01,0.01)
  602. Reg = Region3.new(pos1, pos2)
  603. TouchingParts = game.Workspace:FindPartsInRegion3(Reg)
  604. o = 1
  605. if TouchingParts ~= nil then
  606. for i,v in pairs(TouchingParts) do
  607. if v ~= parter then
  608.  
  609.  
  610. part = v
  611. if part.Parent.Name == "Map" then
  612. if part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  613. hitting = true
  614. parter = part
  615. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y >= Max then
  616. hitting = true
  617. parter = part
  618. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y <= Min then
  619. hitting = true
  620. parter = part
  621. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Min then
  622. hitting = true
  623. parter = part
  624. elseif part.Size.X <= Min and part.Size.Z >= Min and part.Size.Y <= Min then
  625. hitting = true
  626. parter = part
  627. elseif part.Size.X >= Max and part.Size.Z <= Min and part.Size.Y <= Min then
  628. hitting = true
  629. parter = part
  630. elseif part.Size.X >= Max and part.Size.Z >= Max and part.Size.Y <= Min-1 then
  631. hitting = true
  632. parter = part
  633. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Max then
  634. hitting = true
  635. parter = part
  636. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  637. hitting = true
  638. parter = part
  639. elseif part.Size.X <= Min or part.Size.Z <= Min or part.Size.Z <= Min then
  640. hitting = true
  641. parter = part
  642. end
  643. end
  644.  
  645.  
  646. if hitting == true then
  647. table.insert(list, o, v)
  648. o = o + 1
  649. end
  650. end
  651. end
  652. end
  653.  
  654. hitting = false
  655.  
  656. part = parter
  657.  
  658. pos1 = part.Position + (part.Size/2) + Vector3.new(0.01,0.01,0.01)
  659. pos2 = part.Position - (part.Size/2) - Vector3.new(0.01,0.01,0.01)
  660.  
  661. local ray = Ray.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame.p, (v.Character.HumanoidRootPart.CFrame.p - game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame.p).unit * 2000)
  662. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {game:GetService("Players").LocalPlayer.Character, workspace.CurrentCamera, workspace.Ignore, parter, unpack(list)}, false, true)
  663. if part then
  664. if part.Parent == v.Character then
  665. hitting = true
  666. end
  667. end
  668. if hitting == false then
  669. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  670. elseif hitting == true then
  671. if ((parter.Position - v.Character.HumanoidRootPart.Position).magnitude) <= 40 then
  672. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0.666667, 0)
  673. else
  674. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  675. end
  676. end
  677.  
  678. elseif hitting == false then
  679. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  680. end
  681. end
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692. if hitting == false then
  693. local ray = Ray.new(game:GetService("Players").LocalPlayer.Character.Head.CFrame.p, (v.Character.Head.CFrame.p - game:GetService("Players").LocalPlayer.Character.Head.CFrame.p).unit * 2000)
  694. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {game:GetService("Players").LocalPlayer.Character, workspace.CurrentCamera, workspace.Ignore}, false, true)
  695. if part then
  696. if part:IsA("BasePart") then
  697.  
  698. CurrentGun = nil
  699. for i,v in pairs(workspace.CurrentCamera:GetChildren()) do
  700. if v.Name ~= "Right Arm" and v.Name ~= "Left Arm" then
  701. if v:IsA("Model") then
  702. if v:FindFirstChild("Flame") then
  703. CurrentGun = v
  704. break
  705. end
  706. end
  707. end
  708. end
  709.  
  710. found = false
  711.  
  712. if found == false then
  713. for i = 1,#Sniper do
  714. if CurrentGun ~= nil then
  715. if Sniper[i] == CurrentGun.Name then
  716. found = true
  717. Min = 2.75
  718. Max = 3
  719. break
  720. end
  721. end
  722. end
  723. end
  724.  
  725. if found == false then
  726. for i = 1,#SpecialSniper do
  727. if CurrentGun ~= nil then
  728. if SpecialSniper[i] == CurrentGun.Name then
  729. found = true
  730. Min = 3.25
  731. Max = 3.5
  732. break
  733. end
  734. end
  735. end
  736. end
  737.  
  738. if found == false then
  739. for i = 1,#WeakSniper do
  740. if CurrentGun ~= nil then
  741. if WeakSniper[i] == CurrentGun.Name then
  742. found = true
  743. Min = 2.75
  744. Max = 3
  745. break
  746. end
  747. end
  748. end
  749. end
  750.  
  751. if found == false then
  752. for i = 1,#WeakSMG do
  753. if CurrentGun ~= nil then
  754. if WeakSMG[i] == CurrentGun.Name then
  755. found = true
  756. Min = 2.25
  757. Max = 3
  758. break
  759. end
  760. end
  761. end
  762. end
  763.  
  764. if found == false then
  765. for i = 1,#SMG do
  766. if CurrentGun ~= nil then
  767. if SMG[i] == CurrentGun.Name then
  768. found = true
  769. Min = 2.5
  770. Max = 3
  771. break
  772. end
  773. end
  774. end
  775. end
  776.  
  777. if found == false then
  778. for i = 1,#ShotGun do
  779. if CurrentGun ~= nil then
  780. if ShotGun[i] == CurrentGun.Name then
  781. found = true
  782. Min = 2.75
  783. Max = 3
  784. break
  785. end
  786. end
  787. end
  788. end
  789.  
  790. if found == false then
  791. for i = 1,#LMG do
  792. if CurrentGun ~= nil then
  793. if LMG[i] == CurrentGun.Name then
  794. found = true
  795. Min = 2.5
  796. Max = 3
  797. break
  798. end
  799. end
  800. end
  801. end
  802.  
  803. if found == false then
  804. for i = 1,#Other do
  805. if CurrentGun ~= nil then
  806. if Other[i] == CurrentGun.Name then
  807. found = true
  808. Min = 0
  809. Max = 0
  810. break
  811. end
  812. end
  813. end
  814. end
  815.  
  816. if found == false then
  817. for i = 1,#Melee do
  818. if CurrentGun ~= nil then
  819. if Melee[i] == CurrentGun.Name then
  820. found = true
  821. Min = 0
  822. Max = 0
  823. break
  824. end
  825. end
  826. end
  827. end
  828.  
  829. if found == false then
  830. Min = 0
  831. Max = 0
  832. end
  833.  
  834. if part.Parent.Name == "Map" then
  835. if part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  836. hitting = true
  837. parter = part
  838. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y >= Max then
  839. hitting = true
  840. parter = part
  841. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y <= Min then
  842. hitting = true
  843. parter = part
  844. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Min then
  845. hitting = true
  846. parter = part
  847. elseif part.Size.X <= Min and part.Size.Z >= Min and part.Size.Y <= Min then
  848. hitting = true
  849. parter = part
  850. elseif part.Size.X >= Max and part.Size.Z <= Min and part.Size.Y <= Min then
  851. hitting = true
  852. parter = part
  853. elseif part.Size.X >= Max and part.Size.Z >= Max and part.Size.Y <= Min-1 then
  854. hitting = true
  855. parter = part
  856. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Max then
  857. hitting = true
  858. parter = part
  859. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  860. hitting = true
  861. parter = part
  862. elseif part.Size.X <= Min or part.Size.Z <= Min or part.Size.Z <= Min then
  863. hitting = true
  864. parter = part
  865. end
  866. end
  867. end
  868. end
  869. if hitting == true then
  870. hitting = false
  871. part = parter
  872. list = {}
  873. pos1 = part.Position - (part.Size/2) - Vector3.new(0.01,0.01,0.01)
  874. pos2 = part.Position + (part.Size/2) + Vector3.new(0.01,0.01,0.01)
  875. Reg = Region3.new(pos1, pos2)
  876. TouchingParts = game.Workspace:FindPartsInRegion3(Reg)
  877. o = 1
  878. if TouchingParts ~= nil then
  879. for i,v in pairs(TouchingParts) do
  880. if v ~= parter then
  881.  
  882.  
  883. part = v
  884. if part.Parent.Name == "Map" then
  885. if part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  886. hitting = true
  887. parter = part
  888. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y >= Max then
  889. hitting = true
  890. parter = part
  891. elseif part.Size.X <= Min and part.Size.Z >= Max and part.Size.Y <= Min then
  892. hitting = true
  893. parter = part
  894. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Min then
  895. hitting = true
  896. parter = part
  897. elseif part.Size.X <= Min and part.Size.Z >= Min and part.Size.Y <= Min then
  898. hitting = true
  899. parter = part
  900. elseif part.Size.X >= Max and part.Size.Z <= Min and part.Size.Y <= Min then
  901. hitting = true
  902. parter = part
  903. elseif part.Size.X >= Max and part.Size.Z >= Max and part.Size.Y <= Min-1 then
  904. hitting = true
  905. parter = part
  906. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y <= Max then
  907. hitting = true
  908. parter = part
  909. elseif part.Size.X <= Min and part.Size.Z <= Min and part.Size.Y >= Max then
  910. hitting = true
  911. parter = part
  912. elseif part.Size.X <= Min or part.Size.Z <= Min or part.Size.Z <= Min then
  913. hitting = true
  914. parter = part
  915. end
  916. end
  917.  
  918.  
  919. if hitting == true then
  920. table.insert(list, o, v)
  921. o = o + 1
  922. end
  923. end
  924. end
  925. end
  926.  
  927. hitting = false
  928.  
  929. part = parter
  930.  
  931. pos1 = part.Position + (part.Size/2) + Vector3.new(0.01,0.01,0.01)
  932. pos2 = part.Position - (part.Size/2) - Vector3.new(0.01,0.01,0.01)
  933.  
  934. local ray = Ray.new(game:GetService("Players").LocalPlayer.Character.Head.CFrame.p, (v.Character.Head.CFrame.p - game:GetService("Players").LocalPlayer.Character.Head.CFrame.p).unit * 2000)
  935. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {game:GetService("Players").LocalPlayer.Character, workspace.CurrentCamera, workspace.Ignore, parter, unpack(list)}, false, true)
  936. if part then
  937. if part.Parent == v.Character then
  938. hitting = true
  939. end
  940. end
  941. if hitting == false then
  942. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  943. elseif hitting == true then
  944. if ((parter.Position - v.Character.HumanoidRootPart.Position).magnitude) <= 40 then
  945. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0.666667, 0)
  946. else
  947. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  948. end
  949. end
  950.  
  951. elseif hitting == false then
  952. v.Character.HumanoidRootPart.ESP.Frame.BackgroundColor3 = Color3.new(1, 0, 0)
  953. end
  954. end
  955. end
  956.  
  957.  
  958.  
  959. elseif pass == true then
  960. local ESP = Instance.new("BillboardGui",v.Character.HumanoidRootPart)
  961. ESP.Name = "ESP"
  962. ESP.Size = UDim2.new(6, 0, 8, 0)
  963. ESP.StudsOffset = Vector3.new(0, 0.75, 0)
  964. ESP.AlwaysOnTop = true
  965. local Frame = Instance.new("Frame",ESP)
  966. Frame.ZIndex = 1000
  967. Frame.Size = UDim2.new(0.6, 0, 0.8, 0)
  968. Frame.Position = UDim2.new(0.2, 0, 0.3, 0)
  969. Frame.BorderSizePixel = 3
  970. Frame.BackgroundTransparency = 0.3
  971. Frame.BackgroundColor3 = Color3.new(1, 0.666667, 0)
  972. Label = Instance.new("TextLabel", ESP)
  973. Label.Position = UDim2.new(0, 0, -0.1, 0)
  974. Label.Size = UDim2.new(1, 0, 0.3, 0)
  975. Label.Font = "SourceSansLight"
  976. Label.TextColor3 = Color3.new(1,1,1)
  977. Label.TextStrokeColor3 = Color3.new(0,0,0)
  978. Label.TextStrokeTransparency = 0
  979. Label.BackgroundColor3 = Color3.new(1, 1, 1)
  980. Label.TextScaled = true
  981. Label.Text = v.Name.." Distance: "..math.floor(((game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).magnitude))
  982. Label.BackgroundTransparency = 1
  983. end
  984. end
  985. end
  986. end
  987. end
  988. end
  989. end
  990. end
  991. end)
Add Comment
Please, Sign In to add comment