Advertisement
Guest User

Untitled

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