This repository was archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathUniversalEsp.lua
More file actions
1888 lines (1758 loc) · 53.7 KB
/
UniversalEsp.lua
File metadata and controls
1888 lines (1758 loc) · 53.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--[[
v1.7.2 Changes
- Made a few synchronization changes to prevent errors on Synapse
UI Changes
- No UI changes
]]
local VERSION = "v1.7.2"
if not EspSettings then
getgenv().EspSettings = {
TeamCheck = false,
ToggleKey = "RightAlt",
RefreshRate = 10, -- how fast the esp updates (milliseconds)
MaximumDistance = 500, -- only renders players within this distance
FaceCamera = false, -- Makes esp appear 2D
AlignPoints = false, -- Improves 2D effect; only works while FaceCamera is enabled
-- AlignPoints: This may cause esp to have abnormal behavior when looking from certain angles
MouseVisibility = {
Enabled = true, -- makes any drawing objects transparent when they are near your mouse
Radius = 60,
Transparency = 0.3,
Method = "Hover", -- "Radius" or "Hover" | Hover is newest method and is a lot more accurate than Radius
HoverRadius = 50,
Selected = { -- set any of these to false to ignore them
Boxes = true,
Tracers = true,
Names = true,
Skeletons = true,
HealthBars = true,
HeadDots = true,
LookTracers = true
}
},
Highlights = {
Enabled = false,
Players = {}, -- put player usernames into this table to 'highlight' them
Transparency = 1,
Color = Color3.fromRGB(255, 150, 0),
AlwaysOnTop = true
},
NPC = {
Color = Color3.fromRGB(150,150,150),
Transparency = 1,
RainbowColor = false,
Overrides = {
Boxes = true,
Tracers = true,
Names = true,
Skeletons = true,
HealthBars = true,
HeadDots = true,
LookTracers = true
}
},
Boxes = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(255,255,255),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
OutlineThickness = 1,
Thickness = 1
},
Tracers = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(255,255,255),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
OutlineThickness = 1,
Origin = "Top", -- "Top" or "Center" or "Bottom" or "Mouse"
Thickness = 1
},
Names = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(255,255,255),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
Font = Drawing.Fonts.UI, -- UI or System or Plex or Monospace
Size = 18,
ShowDistance = false,
ShowHealth = true,
UseDisplayName = false,
DistanceDataType = "m", -- what it says after the distance (ex. 100m)
HealthDataType = "Percentage" -- "Percentage" or "Value"
},
Skeletons = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(255,255,255),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
OutlineThickness = 1,
Thickness = 1
},
HealthBars = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(0,255,0),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
OutlineThickness = 1,
Origin = "None", -- "None" or "Left" or "Right"
OutlineBarOnly = true
},
HeadDots = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(255,255,255),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
OutlineThickness = 1,
Thickness = 1,
Filled = false,
Scale = 1
},
LookTracers = {
Enabled = true,
Transparency = 1,
Color = Color3.fromRGB(255,255,255),
UseTeamColor = true,
RainbowColor = false,
Outline = true,
OutlineColor = Color3.fromRGB(0,0,0),
OutlineThickness = 1,
Thickness = 1,
Length = 5
}
}
end
if EspSettings.Highlights == nil then
local bind = Instance.new("BindableFunction")
bind.OnInvoke = function()
setclipboard("https://pastebin.com/raw/5zw0rLH9")
end
game:GetService("StarterGui"):SetCore("SendNotification",{
Title = "Universal Esp",
Text = "Please update your script!",
Duration = 5,
Button1 = "Get Latest Script",
Callback = bind
})
return
end
getgenv().EspSettings.Names.OutlineThickness = 0 -- to make setall work
if not Drawing then
game:GetService("Players").LocalPlayer:Kick("\n\nUniversal Esp\nYour exploit does not have a Drawing Library!\n")
return
end
if UESP then
UESP:Destroy()
end
local ZIndexEnabled = pcall(function()
local a = Drawing.new("Square")
a.Visible = false
task.delay(0.1, function()
a:Remove()
end)
a.ZIndex = 1
end)
local players = game:GetService("Players")
local player = players.LocalPlayer
local camera = workspace.CurrentCamera
local uis = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Drawingnew = Drawing.new
local Fonts = Drawing.Fonts
local tableinsert = table.insert
local tablesort = table.sort
local tablefind = table.find
local WorldToViewportPoint = camera.WorldToViewportPoint
local CFramenew = CFrame.new
local Vector2new = Vector2.new
local fromRGB = Color3.fromRGB
local fromHSV = Color3.fromHSV
local mathfloor = math.floor
local mathclamp = math.clamp
local mathhuge = math.huge
local mathabs = math.abs
local mathmin = math.min
local mathmax = math.max
local lower = string.lower
local find = string.find
local osclock = os.clock
local next = next
local tick = tick
local typeof = typeof
local taskspawn = task.spawn
local taskwait = task.wait
local profbegin = debug and debug.profilebegin or function() end
local profend = debug and debug.profileend or function() end
local GetMouseLocation = uis.GetMouseLocation
local GameId = game.GameId
local ss, mousevis, highlights, npcs = getgenv().EspSettings, getgenv().EspSettings.MouseVisibility, getgenv().EspSettings.Highlights, getgenv().EspSettings.NPC
local OBJECTS, VISIBLE, ID, OUTLINES = {}, true, 0, true
--[[local bodyparts = {
"Head","UpperTorso","LowerTorso","LeftUpperArm","LeftLowerArm","LeftHand","RightUpperArm","RightLowerArm","RightHand","LeftUpperLeg","LeftLowerLeg","LeftFoot","RightUpperLeg","RightLowerLeg","RightFoot",
"Torso","Left Arm","Right Arm","Left Leg","Right Leg",
"Chest","Hips","LeftArm","LeftForearm","RightArm","RightForearm","LeftLeg","LeftForeleg","RightLeg","RightForeleg"
}]]
local gids = { -- game ids
['arsenal'] = 111958650,
['pf'] = 113491250,
['pft'] = 115272207, -- pf test place
['pfu'] = 1256867479, -- pf unstable branch
['bb'] = 1168263273,
['rp'] = 2162282815, -- rush point
['mm2'] = 66654135
}
local zindex = {
['Boxes'] = 2,
['Tracers'] = 3,
['Names'] = 6,
['Skeletons'] = 2,
['HealthBars'] = 4,
['HeadDots'] = 3,
['LookTracers'] = 3,
['Labels'] = 5,
['Chams'] = 0
}
local zindex_ontop = { -- zindex for always on top objects
['Boxes'] = 12,
['Tracers'] = 13,
['Names'] = 16,
['Skeletons'] = 12,
['HealthBars'] = 14,
['HeadDots'] = 13,
['LookTracers'] = 13,
['Labels'] = 15,
['Chams'] = 10
}
local Base = {
"Enabled",
"Transparency",
"Color",
"UseTeamColor",
"RainbowColor",
"Outline",
"OutlineColor"
}
local white, black = fromRGB(255,255,255), fromRGB(0,0,0)
local getEntry, ts, characters, teams, rp
if (GameId == gids.pf) or (GameId == gids.pft) or (GameId == gids.pfu) then
local require = rawget(getrenv().shared, "require")
if require == nil then
setclipboard('loadstring(game:HttpGet("https://raw.githubusercontent.com/Spoorloos/scripts/main/pf-actor-bypass.lua"))()')
local a = Instance.new("Message", game.CoreGui)
a.Text = "-- Universal Esp Notice --\n\nA script has been copied to your clipboard.\nPlease put this script in your exploit's autoexec folder and rejoin the game.\n(this script is required to bypass the new update)\n\nbypass was created by Spoorloos"
return
else
local _cache = rawget(debug.getupvalue(require, 1), "_cache")
local ReplicationInterface = rawget(rawget(_cache, "ReplicationInterface"), "module")
getEntry = rawget(ReplicationInterface, "getEntry")
end
elseif GameId == gids.bb then
for _,v in next, getgc(true) do
if typeof(v) == "table" and rawget(v, "InitProjectile") and rawget(v, "TS") then
ts = rawget(v, "TS")
characters = ts.Characters
teams = ts.Teams
end
end
elseif GameId == gids.rp then
rp = true
-- CREDIT TO THIS DUDE FOR CRASH FIX https://v3rmillion.net/showthread.php?pid=8248169#pid8248169
--loadstring(game:HttpGet("https://raw.githubusercontent.com/Github-Account-39021832/Rush-Point-Fix-Crash/main/src.lua"))()
end
local From = {
UpperTorso = "Head",
LowerTorso = "UpperTorso",
LeftUpperArm = "UpperTorso",
RightUpperArm = "UpperTorso",
LeftLowerArm = "LeftUpperArm",
RightLowerArm = "RightUpperArm",
LeftHand = "LeftLowerArm",
RightHand = "RightLowerArm",
LeftUpperLeg = "LowerTorso",
RightUpperLeg = "LowerTorso",
LeftLowerLeg = "LeftUpperLeg",
RightLowerLeg = "RightUpperLeg",
LeftFoot = "LeftLowerLeg",
RightFoot = "RightLowerLeg",
Torso = "Head",
['Left Arm'] = "Torso",
['Right Arm'] = "Torso",
['Left Leg'] = "Torso",
['Right Leg'] = "Torso",
Chest = "Head",
Hips = "Chest",
LeftArm = "Chest",
LeftForearm = "LeftArm",
RightArm = "Chest",
RightForearm = "RightArm",
LeftLeg = "Hips",
LeftForeleg = "LeftLeg",
RightLeg = "Hips",
RightForeleg = "RightLeg"
}
if ts then
From.LeftHand = "LeftForearm"
From.RightHand = "RightForearm"
From.LeftFoot = "LeftForeleg"
From.RightFoot = "RightForeleg"
end
local supportedparts = {
"CornerWedgePart",
"Model",
"NegateOperation",
"Part",
"TrussPart",
"UnionOperation",
"WedgePart",
"MeshPart"
}
local PlayerObjects = {}
local setidentity = setidentity or setthreadidentity or set_thread_identity or setthreadcontext or set_thread_context or (syn and syn.set_thread_identity) or nil
function safecall(func, env, ...)
if not setidentity then
return func(...)
end
local suc, env = pcall(getsenv, env)
return coroutine.wrap(function(...)
setidentity(2)
if suc then
setfenv(0, env)
setfenv(1, env)
end
return func(...)
end)(...)
end
local oldfuncs = {}
function IsAlive(plr)
if plr.ClassName == "Model" then
return true
end
local humanoid = plr.Character and plr.Character:FindFirstChild("Humanoid") or nil
if humanoid and humanoid.Health > 0 then
return true
end
return false
end
function GetChar(plr)
if plr.ClassName == "Model" then
return plr
end
return plr.Character
end
function GetHealth(plr)
if plr.ClassName == "Model" then
local a = plr.Humanoid
return {mathfloor(a.Health), mathfloor(a.MaxHealth)}
end
local a = plr.Character and plr.Character:FindFirstChild("Humanoid") or nil
if a then
return {mathfloor(a.Health), mathfloor(a.MaxHealth)}
end
return {100,100}
end
function GetTeam(plr)
if plr.ClassName == "Model" then
return "NPC"
end
return plr.Team
end
function GetTeamColor(plr)
if plr.ClassName == "Model" then
return npcs.Color
end
return plr.TeamColor.Color
end
function IsFFA()
local t = {}
for _,v in next, players:GetPlayers() do
local team = GetTeam(v)
if team == nil then
return true
end
team = team.Name or team
if t[team] then
return true
else
tableinsert(t, team)
end
end
return #t == 1
end
do -- compatibility
if getEntry then -- phantom forces
local cache = {}
GetChar = function(plr)
local obj = getEntry(plr)
if obj ~= nil then
local char = obj.Character
if char and char.Parent ~= nil then
return char
end
end
return nil
end
IsAlive = GetChar
GetHealth = function(plr)
local obj = getEntry(plr)
if obj ~= nil then
return {mathfloor(obj.Health), 100}
end
return nil
end
end
if ts then -- bad business
local settings = game:GetService("ReplicatedStorage"):WaitForChild("PlayerData"):WaitForChild(player.Name):WaitForChild("Settings")
local function getcolor(a)
local b = settings:WaitForChild(string.format("Team%sColor", a)).Value:split(",")
for i,v in next, b do
b[i] = tonumber(v) / 100
end
return fromHSV(unpack(b))
end
local teamcolors = {
Survivors = getcolor("Survivors"),
Infected = getcolor("Infected"),
FFA = getcolor("FFA"),
Beta = getcolor("Beta"),
Omega = getcolor("Omega")
}
hookfunction(PluginManager, error) -- prevent crash
GetChar = function(plr)
return characters:GetCharacter(plr)
end
IsAlive = GetChar
GetHealth = function(plr)
local a = GetChar(plr)
local hp = a:FindFirstChild("Health")
if hp then
return {mathfloor(hp.Value), mathfloor(hp.MaxHealth.Value)}
end
return {100, 100}
end
GetTeam = function(plr)
return teams:GetPlayerTeam(plr, plr)
end
GetTeamColor = function(plr)
local team = GetTeam(plr)
return (team and teamcolors[team]) or white
end
end
if GameId == gids.arsenal then -- arsenal
GetHealth = function(plr)
local a = plr.NRPBS
return {mathfloor(a.Health.Value), mathfloor(a.MaxHealth.Value)}
end
local ffa = game:GetService("ReplicatedStorage"):WaitForChild("wkspc"):WaitForChild("FFA")
IsFFA = function()
return ffa.Value
end
end
if rp then -- rush point
local mapfolder = workspace:WaitForChild("MapFolder")
local playerfolder = mapfolder:WaitForChild("Players")
local gamestats = mapfolder:WaitForChild("GameStats")
GetChar = function(plr)
return playerfolder:FindFirstChild(plr.Name)
end
IsAlive = GetChar
GetHealth = function(plr)
local char = GetChar(plr) if not char then return {0, 100} end
local humanoid = char:FindFirstChildOfClass("Humanoid") if not humanoid then return {0, 100} end
return {mathfloor(humanoid.Health), mathfloor(humanoid.MaxHealth)}
end
GetTeam = function(plr)
local char = GetChar(plr) if not char then return "" end
local team = char:FindFirstChild("Team") if not team then return "" end
return team.Value
end
GetTeamColor = function(plr)
local char = GetChar(plr) if not char then return white end
local outline = char:FindFirstChild("OutlineESP") if not outline then return white end
return outline.OutlineColor
end
IsFFA = function()
return gamestats.GameMode.Value == "Deathmatch"
end
end
if GameId == gids.mm2 then
local sheriff = Color3.new(0, 0, 1)
local murderer = Color3.new(1, 0, 0)
local innocent = Color3.new(0, 1, 0)
GetTeam = function(plr)
local backpack = plr.Backpack
local char = GetChar(plr)
if (backpack and backpack:FindFirstChild("Gun")) or (char and char:FindFirstChild("Gun")) then
return "Sheriff"
elseif (backpack and backpack:FindFirstChild("Knife")) or (char and char:FindFirstChild("Knife")) then
return "Murderer"
end
return "Innocent"
end
GetTeamColor = function(plr)
local backpack = plr.Backpack
local char = GetChar(plr)
if (backpack and backpack:FindFirstChild("Gun")) or (char and char:FindFirstChild("Gun")) then
return sheriff
elseif (backpack and backpack:FindFirstChild("Knife")) or (char and char:FindFirstChild("Knife")) then
return murderer
end
return innocent
end
end
end
oldfuncs.alive = IsAlive
oldfuncs.character = GetChar
oldfuncs.health = GetHealth
oldfuncs.team = GetTeam
oldfuncs.teamcolor = GetTeamColor
oldfuncs.ffa = IsFFA
----
function ternary(condition, truevalue, falsevalue)
if condition then
return truevalue
end
return falsevalue
end
function ApplyZIndex(obj, name, ontop)
if ZIndexEnabled then
local idx = (ontop and zindex_ontop[name]) or zindex[name]
for i,v in next, obj do
v.ZIndex = (find(i, "Outline") and idx - 1) or idx
end
end
end
function SetProp(obj, prop, value, outline)
for i,v in next, obj do
if (OUTLINES and outline and find(i, "Outline")) or (not outline and OUTLINES) then
v[prop] = value
end
end
end
local Object = {
Boxes = function()
return {
Outline = Drawingnew("Quad"),
Box = Drawingnew("Quad")
}
end,
Tracers = function()
return {
Outline = Drawingnew("Line"),
Tracer = Drawingnew("Line")
}
end,
Names = function()
return {
Name = Drawingnew("Text"),
Data = Drawingnew("Text")
}
end,
Skeletons = function()
return (ts and { -- bad business
ChestOutline = Drawingnew("Line"),
HipsOutline = Drawingnew("Line"),
LeftArmOutline = Drawingnew("Line"),
LeftForearmOutline = Drawingnew("Line"),
LeftHandOutline = Drawingnew("Line"),
RightArmOutline = Drawingnew("Line"),
RightForearmOutline = Drawingnew("Line"),
RightHandOutline = Drawingnew("Line"),
LeftLegOutline = Drawingnew("Line"),
LeftForelegOutline = Drawingnew("Line"),
LeftFootOutline = Drawingnew("Line"),
RightLegOutline = Drawingnew("Line"),
RightForelegOutline = Drawingnew("Line"),
RightFootOutline = Drawingnew("Line"),
Chest = Drawingnew("Line"),
Hips = Drawingnew("Line"),
LeftArm = Drawingnew("Line"),
LeftForearm = Drawingnew("Line"),
LeftHand = Drawingnew("Line"),
RightArm = Drawingnew("Line"),
RightForearm = Drawingnew("Line"),
RightHand = Drawingnew("Line"),
LeftLeg = Drawingnew("Line"),
LeftForeleg = Drawingnew("Line"),
LeftFoot = Drawingnew("Line"),
RightLeg = Drawingnew("Line"),
RightForeleg = Drawingnew("Line"),
RightFoot = Drawingnew("Line")
}) or { -- 42 objects btw
-- R15
UpperTorsoOutline = Drawingnew("Line"),
LowerTorsoOutline = Drawingnew("Line"),
LeftUpperArmOutline = Drawingnew("Line"),
LeftLowerArmOutline = Drawingnew("Line"),
LeftHandOutline = Drawingnew("Line"),
RightUpperArmOutline = Drawingnew("Line"),
RightLowerArmOutline = Drawingnew("Line"),
RightHandOutline = Drawingnew("Line"),
LeftUpperLegOutline = Drawingnew("Line"),
LeftLowerLegOutline = Drawingnew("Line"),
LeftFootOutline = Drawingnew("Line"),
RightUpperLegOutline = Drawingnew("Line"),
RightLowerLegOutline = Drawingnew("Line"),
RightFootOutline = Drawingnew("Line"),
UpperTorso = Drawingnew("Line"),
LowerTorso = Drawingnew("Line"),
LeftUpperArm = Drawingnew("Line"),
LeftLowerArm = Drawingnew("Line"),
LeftHand = Drawingnew("Line"),
RightUpperArm = Drawingnew("Line"),
RightLowerArm = Drawingnew("Line"),
RightHand = Drawingnew("Line"),
LeftUpperLeg = Drawingnew("Line"),
LeftLowerLeg = Drawingnew("Line"),
LeftFoot = Drawingnew("Line"),
RightUpperLeg = Drawingnew("Line"),
RightLowerLeg = Drawingnew("Line"),
RightFoot = Drawingnew("Line"),
-- R6
TorsoOutline = Drawingnew("Line"),
["Left ArmOutline"] = Drawingnew("Line"),
["Right ArmOutline"] = Drawingnew("Line"),
["Left LegOutline"] = Drawingnew("Line"),
["Right LegOutline"] = Drawingnew("Line"),
Torso = Drawingnew("Line"),
["Left Arm"] = Drawingnew("Line"),
["Right Arm"] = Drawingnew("Line"),
["Left Leg"] = Drawingnew("Line"),
["Right Leg"] = Drawingnew("Line")
}
end,
HealthBars = function()
return {
Outline = Drawingnew("Quad"),
Bar = Drawingnew("Quad")
}
end,
HeadDots = function()
return {
Outline = Drawingnew("Circle"),
Dot = Drawingnew("Circle")
}
end,
LookTracers = function()
return {
Outline = Drawingnew("Line"),
Tracer = Drawingnew("Line")
}
end,
Labels = function()
return {
Label = Drawingnew("Text")
}
end,
Chams = function()
return {
Top = Drawingnew("Quad"),
Bottom = Drawingnew("Quad"),
Left = Drawingnew("Quad"),
Right = Drawingnew("Quad"),
Front = Drawingnew("Quad"),
Back = Drawingnew("Quad")
}
end
}
local RemoveFunction = {
Boxes = function(self)
if self.Destroyed then return end
self.Object.Box:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
Tracers = function(self)
if self.Destroyed then return end
self.Object.Tracer:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
Names = function(self)
if self.Destroyed then return end
self.Object.Name:Remove()
self.Object.Data:Remove()
self.Destroyed = true
end,
Skeletons = function(self)
if self.Destroyed then return end
for _,v in next, self.Object do
v:Remove()
end
self.Destroyed = true
end,
HealthBars = function(self)
if self.Destroyed then return end
self.Object.Bar:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
HeadDots = function(self)
if self.Destroyed then return end
self.Object.Dot:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
LookTracers = function(self)
if self.Destroyed then return end
self.Object.Tracer:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
Labels = function(self)
if self.Destroyed then return end
self.Object.Label:Remove()
self.AncestryChanged:Disconnect()
self.Destroyed = true
end,
Chams = function(self)
if self.Destroyed then return end
self.Object.Top:Remove()
self.Object.Bottom:Remove()
self.Object.Left:Remove()
self.Object.Right:Remove()
self.Object.Front:Remove()
self.Object.Back:Remove()
self.AncestryChanged:Disconnect()
self.Destroyed = true
end
}
function NewObject(type) -- create the actual drawing objects
local obj = Object[type]()
SetProp(obj, "Visible", false)
ApplyZIndex(obj, type)
return obj
end
function NewCharacterObject(objs, type, plr) -- create data object for players and npcs
ID += 1
local t = {
Object = objs,
Type = type,
Player = plr,
NPC = plr.ClassName ~= "Player",
Destroyed = false,
Id = ID,
Remove = RemoveFunction[type]
}
OBJECTS[ID] = t
return t
end
local props = {
Labels = {
Text = "string",
Transparency = "number",
Color = "Color3",
RainbowColor = "boolean",
Size = "number",
Outline = "boolean",
OutlineColor = "Color3",
Font = "number",
Offset = "Vector2"
},
Chams = {
Transparency = "number",
Color = "Color3",
RainbowColor = "boolean",
Thickness = "number",
Filled = "boolean"
}
}
function PartSetPart(self, p) -- SetPart function for labels and chams
assert(typeof(p) == "Instance", ("Universal Esp: bad argument #1 to 'SetPart' (Instance expected, got %s)"):format(typeof(p)))
assert(tablefind(supportedparts, p.ClassName), ("Universal Esp: bad argument #1 to 'SetPart' (BasePart or Model expected, got %s)"):format(p.ClassName))
self.Part = p
end
function PartSetProp(self, prop, value) -- SetProp function for labels and chams
assert(prop ~= nil, "Universal Esp: bad argument #1 to 'SetProp' (property is nil)")
assert(self.Options[prop] ~= nil, "Universal Esp: bad argument #1 to 'SetProp' (invalid property)")
local expected, got = props[self.Type][prop], typeof(value)
assert(expected == got,("Universal Esp: bad argument to #2 'SetProp' (%s expected, got %s)"):format(expected, got))
self.Options[prop] = value
end
function NewPartObject(objs, type, part, options) -- create data object for parts and models
ID += 1
local t = {
Object = objs,
Type = type,
Part = part,
Options = options,
Destroyed = false,
Id = ID,
AncestryChanged = nil,
SetPart = PartSetPart,
SetProp = PartSetProp,
Remove = RemoveFunction[type]
}
t.AncestryChanged = part.AncestryChanged:Connect(function(_, parent)
if parent == nil then
t:Remove()
return
end
t:SetPart(parent:FindFirstChild(part.Name))
end)
OBJECTS[ID] = t
return t
end
local ss = getgenv().EspSettings
local origins = {}
local mousepos = Vector2.zero
local ffa = IsFFA()
local myteam = GetTeam(player)
local ccf = camera.CFrame.Position
local camfov = camera.FieldOfView
local rainbow = fromHSV(tick() % 5 / 5, 1, 1)
local teamcheck = ss.TeamCheck
local maxdist = ss.MaximumDistance
local facecamera = ss.FaceCamera
local alignpoints = ss.AlignPoints
local refreshrate = ss.RefreshRate / 1000
local mv_enabled = mousevis.Enabled
local mv_selected = mousevis.Selected
local mv_transparency = mousevis.Transparency
local mv_method = mousevis.Method and lower(mousevis.Method) or nil
local mv_radius = mousevis.Radius
local mv_hoverradius = mousevis.HoverRadius or 10
local hl_enabled = highlights.Enabled
local hl_players = highlights.Players
local hl_color = highlights.Color
local hl_transparency = highlights.Transparency
local hl_ontop = highlights.AlwaysOnTop
local npc_overrides = npcs.Overrides
local npc_color = npcs.Color
local npc_transparency = npcs.Transparency
local npc_rainbow = npcs.Rainbow
local Boxes = ss.Boxes
local Tracers = ss.Tracers
local Names = ss.Names
local Skeletons = ss.Skeletons
local HealthBars = ss.HealthBars
local HeadDots = ss.HeadDots
local LookTracers = ss.LookTracers
function UpdateVariables() -- set variables once per frame so it doesnt have to do it multiple times
ss = getgenv().EspSettings
mousepos = GetMouseLocation(uis)
local x, y = camera.ViewportSize.X, camera.ViewportSize.Y
origins = {
top = Vector2new(x / 2, 0),
center = Vector2new(x / 2, y / 2),
bottom = Vector2new(x / 2, y),
mouse = mousepos
}
ffa = IsFFA()
myteam = GetTeam(player)
ccf = camera.CFrame.Position
camfov = camera.FieldOfView
rainbow = fromHSV(tick() % 5 / 5, 1, 1)
teamcheck = ss.TeamCheck
maxdist = ss.MaximumDistance
facecamera = ss.FaceCamera
alignpoints = ss.AlignPoints
refreshrate = ss.RefreshRate / 1000
mv_enabled = mousevis.Enabled
mv_selected = mousevis.Selected
mv_transparency = mousevis.Transparency
mv_method = mousevis.Method and lower(mousevis.Method) or nil
mv_radius = mousevis.Radius
mv_hoverradius = mousevis.HoverRadius
hl_enabled = highlights.Enabled
hl_players = highlights.Players
hl_color = highlights.Color
hl_transparency = highlights.Transparency
hl_ontop = highlights.Always
npc_overrides = npcs.Overrides
npc_color = npcs.Color
npc_transparency = npcs.Transparency
npc_rainbow = npcs.Rainbow
ss = getgenv().EspSettings
Boxes = ss.Boxes
Tracers = ss.Tracers
Names = ss.Names
Skeletons = ss.Skeletons
HealthBars = ss.HealthBars
HeadDots = ss.HeadDots
LookTracers = ss.LookTracers
end
UpdateVariables()
local conn2 = RunService.Heartbeat:Connect(UpdateVariables)
function UpdateObjects(self) -- update esp objects for players and npcs
local plr, isnpc = self.Player, self.NPC
local cf, size, mid, inViewport, tl, tr, bl, br
local tlx, tly, tlz, trx, try, blx, bly, brx, bry, z
local head, ltracerto
local team, teamcolor
local health, maxhealth, mag, overlapping, render
local char = plr and GetChar(plr)
local objs = self.Objects
local box = objs.Box.Object
local tracer = objs.Tracer.Object
local name = objs.Name.Object
local skeleton = objs.Skeleton.Object
local bar = objs.HealthBar.Object
local dot = objs.HeadDot.Object
local ltracer = objs.LookTracer.Object
if VISIBLE and char then
local hp = GetHealth(plr)
health, maxhealth = hp[1], hp[2]
cf, size = char:GetBoundingBox()
team, teamcolor = GetTeam(plr), GetTeamColor(plr)
mag = (ccf - cf.Position).Magnitude
render = (ffa or (not teamcheck or (not ffa and teamcheck and team ~= myteam))) and mag <= maxdist
mid, inViewport = WorldToViewportPoint(camera, cf.Position)
local BOXES = Boxes.Enabled
local TRACERS = Tracers.Enabled
local NAMES = Names.Enabled
local SKELETONS = Skeletons.Enabled
local HEALTHBARS = HealthBars.Enabled
local HEADDOTS = HeadDots.Enabled
local LOOKTRACERS = LookTracers.Enabled
SetProp(box, "Visible", render and inViewport and BOXES)
SetProp(tracer, "Visible", render and inViewport and TRACERS)
SetProp(name, "Visible", render and inViewport and NAMES)
SetProp(skeleton, "Visible", render and inViewport and SKELETONS)
SetProp(bar, "Visible", render and inViewport and HEALTHBARS)
SetProp(dot, "Visible", render and inViewport and HEADDOTS)
SetProp(ltracer, "Visible", render and inViewport and LOOKTRACERS)
if render and inViewport then
do
if facecamera then
cf = CFramenew(cf.Position, ccf)
end
size /= 2
local x, y = size.X, size.Y
--mid, inViewport = WorldToViewportPoint(camera, cf.Position)
tl = WorldToViewportPoint(camera, (cf * CFramenew(-x, y, 0)).Position)
tr = WorldToViewportPoint(camera, (cf * CFramenew( x, y, 0)).Position)
bl = WorldToViewportPoint(camera, (cf * CFramenew(-x, -y, 0)).Position)
br = WorldToViewportPoint(camera, (cf * CFramenew( x, -y, 0)).Position)
tlx, tly, tlz = tl.X, tl.Y, tl.Z
trx, try = tr.X, tr.Y
blx, bly = bl.X, bl.Y
brx, bry = br.X, br.Y