Advertisement
Vzurxy

Untitled

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