Advertisement
Guest User

Phantom Forces Aimbot (Synapse)

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