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