-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsiri.lua
More file actions
1268 lines (1097 loc) · 39.7 KB
/
siri.lua
File metadata and controls
1268 lines (1097 loc) · 39.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
--!nocheck
--!nolint
local KirkImagesInput, CharacterIconsInput, DeviceIconsInput = ...
local CoreGui: CoreGui = game:GetService("CoreGui")
local RS: RunService = game:GetService("RunService")
local Players: Players = game:GetService("Players")
local Workspace: Workspace = workspace
local LocalPlayer: Player = Players.LocalPlayer
local Camera: Camera = Workspace.CurrentCamera
local ViewportSize: Vector2 = Camera.ViewportSize
local Container: Folder = Instance.new("Folder", (gethui and gethui()) or CoreGui)
local KirkImages = KirkImagesInput or {
default = "OriginalKirk.jpg",
survivor = {},
killer = {},
}
local CharacterIcons = CharacterIconsInput or {}
local DeviceIcons = DeviceIconsInput or {}
local Skeleton: Model = Instance.new("Model")
Skeleton.Name = "Skeleton"
Skeleton.WorldPivot = CFrame.new(-3, 2.5, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
local Head: Part = Instance.new("Part")
Head.Name = "Head"
Head.Anchored = true
Head.BottomSurface = Enum.SurfaceType.Smooth
Head.BrickColor = BrickColor.Black()
Head.CFrame = CFrame.new(-3, 4.5, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Head.Color = Color3.fromRGB(27, 42, 53)
Head.Size = Vector3.new(1.7, 0.851, 0.851)
Head.TopSurface = Enum.SurfaceType.Smooth
local Mesh: SpecialMesh = Instance.new("SpecialMesh")
Mesh.Name = "Mesh"
Mesh.MeshType = Enum.MeshType.FileMesh
Mesh.MeshId = "rbxassetid://36869983"
Mesh.TextureId = "rbxassetid://36869975"
Mesh.Scale = Vector3.new(0.851, 0.851, 0.851)
Mesh.Parent = Head
Head.Parent = Skeleton
local Torso: Part = Instance.new("Part")
Torso.Name = "Torso"
Torso.Anchored = true
Torso.BottomSurface = Enum.SurfaceType.Smooth
Torso.BrickColor = BrickColor.Black()
Torso.CFrame = CFrame.new(-3, 3, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Torso.Color = Color3.fromRGB(27, 42, 53)
Torso.Size = Vector3.new(2, 2, 1)
Torso.TopSurface = Enum.SurfaceType.Smooth
local Mesh1: SpecialMesh = Instance.new("SpecialMesh")
Mesh1.Name = "Mesh"
Mesh1.MeshType = Enum.MeshType.FileMesh
Mesh1.MeshId = "rbxassetid://36780113"
Mesh1.TextureId = "rbxassetid://36780292"
Mesh1.Parent = Torso
Torso.Parent = Skeleton
local RightArm: Part = Instance.new("Part")
RightArm.Name = "Right Arm"
RightArm.Anchored = true
RightArm.BottomSurface = Enum.SurfaceType.Smooth
RightArm.BrickColor = BrickColor.Black()
RightArm.CFrame = CFrame.new(-1.5, 3, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
RightArm.Color = Color3.fromRGB(27, 42, 53)
RightArm.Size = Vector3.new(1, 2, 1)
RightArm.TopSurface = Enum.SurfaceType.Smooth
local Mesh2: SpecialMesh = Instance.new("SpecialMesh")
Mesh2.Name = "Mesh"
Mesh2.MeshType = Enum.MeshType.FileMesh
Mesh2.MeshId = "rbxassetid://36780156"
Mesh2.TextureId = "rbxassetid://36780292"
Mesh2.Parent = RightArm
RightArm.Parent = Skeleton
local LeftArm: Part = Instance.new("Part")
LeftArm.Name = "Left Arm"
LeftArm.Anchored = true
LeftArm.BottomSurface = Enum.SurfaceType.Smooth
LeftArm.BrickColor = BrickColor.Black()
LeftArm.CFrame = CFrame.new(-4.5, 3, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
LeftArm.Color = Color3.fromRGB(27, 42, 53)
LeftArm.Size = Vector3.new(1, 2, 1)
LeftArm.TopSurface = Enum.SurfaceType.Smooth
local Mesh3: SpecialMesh = Instance.new("SpecialMesh")
Mesh3.Name = "Mesh"
Mesh3.MeshType = Enum.MeshType.FileMesh
Mesh3.MeshId = "rbxassetid://36780032"
Mesh3.TextureId = "rbxassetid://36780292"
Mesh3.Parent = LeftArm
LeftArm.Parent = Skeleton
local LeftLeg: Part = Instance.new("Part")
LeftLeg.Name = "Left Leg"
LeftLeg.Anchored = true
LeftLeg.BottomSurface = Enum.SurfaceType.Smooth
LeftLeg.BrickColor = BrickColor.Black()
LeftLeg.CFrame = CFrame.new(-3.5, 1, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
LeftLeg.Color = Color3.fromRGB(27, 42, 53)
LeftLeg.Size = Vector3.new(1, 2, 1)
LeftLeg.TopSurface = Enum.SurfaceType.Smooth
local Mesh4: SpecialMesh = Instance.new("SpecialMesh")
Mesh4.Name = "Mesh"
Mesh4.MeshType = Enum.MeshType.FileMesh
Mesh4.MeshId = "rbxassetid://36780079"
Mesh4.TextureId = "rbxassetid://36780292"
Mesh4.Parent = LeftLeg
LeftLeg.Parent = Skeleton
local RightLeg: Part = Instance.new("Part")
RightLeg.Name = "Right Leg"
RightLeg.Anchored = true
RightLeg.BottomSurface = Enum.SurfaceType.Smooth
RightLeg.BrickColor = BrickColor.Black()
RightLeg.CFrame = CFrame.new(-2.5, 1, 71.3599701, 1, 0, 0, 0, 1, 0, 0, 0, 1)
RightLeg.Color = Color3.fromRGB(27, 42, 53)
RightLeg.Size = Vector3.new(1, 2, 1)
RightLeg.TopSurface = Enum.SurfaceType.Smooth
local Mesh5: SpecialMesh = Instance.new("SpecialMesh")
Mesh5.Name = "Mesh"
Mesh5.MeshType = Enum.MeshType.FileMesh
Mesh5.MeshId = "rbxassetid://36780195"
Mesh5.TextureId = "rbxassetid://36780292"
Mesh5.Parent = RightLeg
RightLeg.Parent = Skeleton
Skeleton.Parent = Container
local Floor = math.floor
local Round = math.round
local Sin = math.sin
local Cos = math.cos
local Clear = table.clear
local Unpack = table.unpack
local Find = table.find
local Create = table.create
local FromMatrix = CFrame.fromMatrix
local WTVP = Camera.WorldToViewportPoint
local IsA = Workspace.IsA
local GetPivot = Workspace.GetPivot
local FindFirstChild = Workspace.FindFirstChild
local FindFirstChildOfClass = Workspace.FindFirstChildOfClass
local GetChildren = Workspace.GetChildren
local ToOrientation = CFrame.identity.ToOrientation
local PointToObjectSpace = CFrame.identity.PointToObjectSpace
local LerpColor = Color3.new().Lerp
local Min2 = Vector2.zero.Min
local Max2 = Vector2.zero.Max
local Lerp2 = Vector2.zero.Lerp
local Min3 = Vector3.zero.Min
local Max3 = Vector3.zero.Max
local HEALTH_BAR_OFFSET: Vector2 = Vector2.new(5, 0)
local HEALTH_TEXT_OFFSET: Vector2 = Vector2.new(3, 0)
local HEALTH_BAR_OUTLINE_OFFSET: Vector2 = Vector2.new(0, 1)
local NAME_OFFSET: Vector2 = Vector2.new(0, 2)
local DISTANCE_OFFSET: Vector2 = Vector2.new(0, 2)
local VERTICES: { Vector3 } = {
Vector3.new(-1, -1, -1),
Vector3.new(-1, 1, -1),
Vector3.new(-1, 1, 1),
Vector3.new(-1, -1, 1),
Vector3.new(1, -1, -1),
Vector3.new(1, 1, -1),
Vector3.new(1, 1, 1),
Vector3.new(1, -1, 1),
}
local SkeletonSource: Model = Container:WaitForChild("Skeleton")
local SkeletonGui: ScreenGui = Instance.new("ScreenGui")
SkeletonGui.Name = "SkeletonOverlay"
SkeletonGui.IgnoreGuiInset = true
SkeletonGui.DisplayOrder = 200
SkeletonGui.ResetOnSpawn = false
SkeletonGui.Parent = (gethui and gethui()) or CoreGui
local SkeletonViewport: ViewportFrame = Instance.new("ViewportFrame")
SkeletonViewport.Size = UDim2.fromScale(1, 1)
SkeletonViewport.BackgroundTransparency = 1
SkeletonViewport.Ambient = Color3.new(1, 1, 1)
SkeletonViewport.LightColor = Color3.new(1, 1, 1)
SkeletonViewport.Parent = SkeletonGui
local SkeletonCamera: Camera = Instance.new("Camera")
SkeletonCamera.Parent = SkeletonViewport
SkeletonViewport.CurrentCamera = SkeletonCamera
local SkeletonWorld: WorldModel = Instance.new("WorldModel")
SkeletonWorld.Parent = SkeletonViewport
local KirkGui: ScreenGui = Instance.new("ScreenGui")
KirkGui.Name = "KirkOverlay"
KirkGui.IgnoreGuiInset = true
KirkGui.DisplayOrder = 201
KirkGui.ResetOnSpawn = false
KirkGui.Parent = (gethui and gethui()) or CoreGui
local IconGui: ScreenGui = Instance.new("ScreenGui")
IconGui.Name = "IconOverlay"
IconGui.IgnoreGuiInset = true
IconGui.DisplayOrder = 202
IconGui.ResetOnSpawn = false
IconGui.Parent = (gethui and gethui()) or CoreGui
local function IsBodyPart(Name: string): boolean
return Name == "Head" or Name:find("Torso") or Name:find("Leg") or Name:find("Arm")
end
local function GetBoundingBox(Parts: { BasePart }): (CFrame, Vector3)
local Min: Vector3, Max: Vector3
for i = 1, #Parts do
local Part = Parts[i]
local Cframe, Size = Part.CFrame, Part.Size
Min = Min3(Min or Cframe.Position, (Cframe - Size * 0.5).Position)
Max = Max3(Max or Cframe.Position, (Cframe + Size * 0.5).Position)
end
local Center = (Min + Max) * 0.5
local Front = Vector3.new(Center.X, Center.Y, Max.Z)
return CFrame.new(Center, Front), Max - Min
end
local function WorldToScreen(World: Vector3): (Vector2, boolean, number)
local Screen, InBounds = WTVP(Camera, World)
return Vector2.new(Screen.X, Screen.Y), InBounds, Screen.Z
end
local function CalculateCorners(Cframe: CFrame, Size: Vector3): table
local Corners = Create(#VERTICES)
for i = 1, #VERTICES do
Corners[i] = WorldToScreen((Cframe + Size * 0.5 * VERTICES[i]).Position)
end
local Min = Min2(ViewportSize, Unpack(Corners))
local Max = Max2(Vector2.zero, Unpack(Corners))
return {
Corners = Corners,
TopLeft = Vector2.new(Floor(Min.X), Floor(Min.Y)),
TopRight = Vector2.new(Floor(Max.X), Floor(Min.Y)),
BottomLeft = Vector2.new(Floor(Min.X), Floor(Max.Y)),
BottomRight = Vector2.new(Floor(Max.X), Floor(Max.Y)),
}
end
local function RotateVector(Vector: Vector2, Radians: number): Vector2
local X, Y = Vector.X, Vector.Y
local C, S = Cos(Radians), Sin(Radians)
return Vector2.new(X * C - Y * S, X * S + Y * C)
end
local function ParseColor(Self: any, Color: Color3 | string, IsOutline: boolean): Color3
if Color == "Team Color" or (Self.Interface.sharedSettings.useTeamColor and not IsOutline) then
return Self.Interface.GetTeamColor(Self.Player) or Color3.new(1, 1, 1)
end
return Color
end
local EspObject = {}
EspObject.__index = EspObject
function EspObject.New(Player: Player, Interface: table)
local Self = setmetatable({}, EspObject)
Self.Player = assert(Player, "Missing argument #1 (Player expected)")
Self.Interface = assert(Interface, "Missing argument #2 (table expected)")
Self:Construct()
return Self
end
function EspObject:_Create(Class: string, Properties: table)
local DrawingObject = Drawing.new(Class)
for Property, Value in next, Properties do
pcall(function()
DrawingObject[Property] = Value
end)
end
self.Bin[#self.Bin + 1] = DrawingObject
return DrawingObject
end
function EspObject:Construct()
self.CharCache = {}
self.ChildCount = 0
self.Bin = {}
self.Drawings = {
Box3d = {
{
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
},
{
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
},
{
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
},
{
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
self:_Create("Line", { Thickness = 1, Visible = false }),
},
},
Visible = {
TracerOutline = self:_Create("Line", { Thickness = 3, Visible = false }),
Tracer = self:_Create("Line", { Thickness = 1, Visible = false }),
BoxFill = self:_Create("Square", { Filled = true, Visible = false }),
BoxOutline = self:_Create("Square", { Thickness = 3, Visible = false }),
Box = self:_Create("Square", { Thickness = 1, Visible = false }),
HealthBarOutline = self:_Create("Line", { Thickness = 3, Visible = false }),
HealthBar = self:_Create("Line", { Thickness = 1, Visible = false }),
HealthText = self:_Create("Text", { Center = true, Visible = false }),
Name = self:_Create("Text", { Text = self.Player.DisplayName, Center = true, Visible = false }),
Distance = self:_Create("Text", { Center = true, Visible = false }),
Weapon = self:_Create("Text", { Center = true, Visible = false }),
},
Hidden = {
ArrowOutline = self:_Create("Triangle", { Thickness = 3, Visible = false }),
Arrow = self:_Create("Triangle", { Filled = true, Visible = false }),
},
}
self.KirkImage = Instance.new("ImageLabel")
self.KirkImage.Name = "KirkImage_" .. self.Player.Name
self.KirkImage.BackgroundTransparency = 1
self.KirkImage.BorderSizePixel = 0
self.KirkImage.ScaleType = Enum.ScaleType.Stretch
self.KirkImage.Visible = false
self.KirkImage.Parent = KirkGui
self.IconBillboard = Instance.new("BillboardGui")
self.IconBillboard.Name = "IconESP_" .. self.Player.Name
self.IconBillboard.Adornee = nil
self.IconBillboard.AlwaysOnTop = true
self.IconBillboard.Size = UDim2.fromOffset(250, 60)
self.IconBillboard.StudsOffset = Vector3.new(0, 4, 0)
self.IconBillboard.ResetOnSpawn = false
self.IconBillboard.Parent = IconGui
local IconContainer = Instance.new("Frame")
IconContainer.Name = "Container"
IconContainer.Size = UDim2.fromScale(1, 1)
IconContainer.BackgroundTransparency = 1
IconContainer.Parent = self.IconBillboard
local IconLayout = Instance.new("UIListLayout")
IconLayout.FillDirection = Enum.FillDirection.Horizontal
IconLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
IconLayout.VerticalAlignment = Enum.VerticalAlignment.Center
IconLayout.Padding = UDim.new(0, 5)
IconLayout.Parent = IconContainer
self.CharacterIcon = Instance.new("ImageLabel")
self.CharacterIcon.Name = "CharIcon"
self.CharacterIcon.BackgroundTransparency = 1
self.CharacterIcon.ScaleType = Enum.ScaleType.Fit
self.CharacterIcon.Parent = IconContainer
local IconCorner = Instance.new("UICorner")
IconCorner.CornerRadius = UDim.new(1, 0)
IconCorner.Parent = self.CharacterIcon
self.DeviceIcon = Instance.new("ImageLabel")
self.DeviceIcon.Name = "DeviceIcon"
self.DeviceIcon.BackgroundTransparency = 1
self.DeviceIcon.ScaleType = Enum.ScaleType.Fit
self.DeviceIcon.Parent = IconContainer
self.RenderConnection = RS.Heartbeat:Connect(function(DeltaTime: number)
self:Update(DeltaTime)
self:Render(DeltaTime)
end)
end
function EspObject:Destruct()
self.RenderConnection:Disconnect()
if self.KirkImage then
self.KirkImage:Destroy()
end
if self.IconBillboard then
self.IconBillboard:Destroy()
end
for i = 1, #self.Bin do
self.Bin[i]:Remove()
end
Clear(self)
end
function EspObject:Update()
local Interface = self.Interface
self.Options = Interface.teamSettings[Interface.IsFriendly(self.Player) and "friendly" or "enemy"]
self.Character = Interface.GetCharacter(self.Player)
self.Health, self.MaxHealth = Interface.GetHealth(self.Player)
self.Weapon = Interface.GetWeapon(self.Player)
self.Enabled = self.Options.enabled
and self.Character
and not (#Interface.whitelist > 0 and not Find(Interface.whitelist, self.Player.UserId))
local TargetHead = self.Enabled and FindFirstChild(self.Character, "Head")
if TargetHead then
self.IconBillboard.Adornee = TargetHead
else
self.IconBillboard.Adornee = nil
end
if not TargetHead then
self.CharCache = {}
self.OnScreen = false
return
end
local _, OnScreen, Depth = WorldToScreen(TargetHead.Position)
self.OnScreen = OnScreen
self.Distance = Depth
if Interface.sharedSettings.limitDistance and Depth > Interface.sharedSettings.maxDistance then
self.OnScreen = false
end
if self.OnScreen then
local Cache = self.CharCache
local Children = GetChildren(self.Character)
if not Cache[1] or self.ChildCount ~= #Children then
Clear(Cache)
for i = 1, #Children do
local Part = Children[i]
if IsA(Part, "BasePart") and IsBodyPart(Part.Name) then
Cache[#Cache + 1] = Part
end
end
self.ChildCount = #Children
end
self.Corners = CalculateCorners(GetBoundingBox(Cache))
elseif self.Options.offScreenArrow then
local CameraCFrame = Camera.CFrame
local Flat = FromMatrix(CameraCFrame.Position, CameraCFrame.RightVector, Vector3.yAxis)
local ObjectSpace = PointToObjectSpace(Flat, TargetHead.Position)
self.Direction = Vector2.new(ObjectSpace.X, ObjectSpace.Z).Unit
end
end
local KirkAssetCache = {}
local KirkDefaultAsset = nil
local function PrefetchKirkAssets()
local Base = "Fartsaken/Assets/Kirks/"
if not getcustomasset then
return
end
local function Add(File: string)
if type(File) ~= "string" or File == "" or KirkAssetCache[File] then
return
end
local Path = Base .. File
if File:sub(-4) == ".png" then
Path = Path .. ".Fart"
end
local Success, Asset = pcall(getcustomasset, Path)
if Success and type(Asset) == "string" and Asset ~= "" then
KirkAssetCache[File] = Asset
end
end
Add(KirkImages.default)
for _, Role in ipairs({ "survivor", "killer" }) do
local T = KirkImages[Role]
if type(T) == "table" then
for _, File in pairs(T) do
Add(File)
end
end
end
KirkDefaultAsset = KirkAssetCache[KirkImages.default]
end
local function GetKirkAsset(Role: string, PlayerName: string): string
local File
local RoleTable = type(KirkImages) == "table" and KirkImages[Role]
if type(RoleTable) == "table" then
local V = RoleTable[PlayerName]
if type(V) == "string" and V ~= "" then
File = V
end
end
File = File or (type(KirkImages) == "table" and KirkImages.default) or "OriginalKirk.jpg"
return KirkAssetCache[File] or KirkDefaultAsset or ""
end
PrefetchKirkAssets()
function EspObject:Render()
local OnScreen = self.OnScreen or false
local Enabled = self.Enabled or false
local Visible = self.Drawings.Visible
local Hidden = self.Drawings.Hidden
local Box3d = self.Drawings.Box3d
local Interface = self.Interface
local Options = self.Options
local Corners = self.Corners
Visible.Box.Visible = Enabled and OnScreen and Options.box
Visible.BoxOutline.Visible = Visible.Box.Visible and Options.boxOutline
if Visible.Box.Visible then
local Box = Visible.Box
Box.Position = Corners.TopLeft
Box.Size = Corners.BottomRight - Corners.TopLeft
Box.Color = ParseColor(self, Options.boxColor[1], false)
Box.Transparency = Options.boxColor[2]
local BoxOutline = Visible.BoxOutline
BoxOutline.Position = Box.Position
BoxOutline.Size = Box.Size
BoxOutline.Color = ParseColor(self, Options.boxOutlineColor[1], true)
BoxOutline.Transparency = Options.boxOutlineColor[2]
end
Visible.BoxFill.Visible = Enabled and OnScreen and Options.boxFill
if Visible.BoxFill.Visible then
local BoxFill = Visible.BoxFill
BoxFill.Position = Corners.TopLeft
BoxFill.Size = Corners.BottomRight - Corners.TopLeft
BoxFill.Color = ParseColor(self, Options.boxFillColor[1], false)
BoxFill.Transparency = Options.boxFillColor[2]
end
Visible.HealthBar.Visible = Enabled and OnScreen and Options.healthBar
Visible.HealthBarOutline.Visible = Visible.HealthBar.Visible and Options.healthBarOutline
if Visible.HealthBar.Visible then
local BarFrom = Corners.TopLeft - HEALTH_BAR_OFFSET
local BarTo = Corners.BottomLeft - HEALTH_BAR_OFFSET
local HealthBar = Visible.HealthBar
HealthBar.To = BarTo
HealthBar.From = Lerp2(BarTo, BarFrom, self.Health / self.MaxHealth)
HealthBar.Color = LerpColor(Options.dyingColor, Options.healthyColor, self.Health / self.MaxHealth)
local HealthBarOutline = Visible.HealthBarOutline
HealthBarOutline.To = BarTo + HEALTH_BAR_OUTLINE_OFFSET
HealthBarOutline.From = BarFrom - HEALTH_BAR_OUTLINE_OFFSET
HealthBarOutline.Color = ParseColor(self, Options.healthBarOutlineColor[1], true)
HealthBarOutline.Transparency = Options.healthBarOutlineColor[2]
end
Visible.HealthText.Visible = Enabled and OnScreen and Options.healthText
if Visible.HealthText.Visible then
local BarFrom = Corners.TopLeft - HEALTH_BAR_OFFSET
local BarTo = Corners.BottomLeft - HEALTH_BAR_OFFSET
local HealthText = Visible.HealthText
HealthText.Text = Round(self.Health) .. "hp"
HealthText.Size = Interface.sharedSettings.textSize
HealthText.Font = Interface.sharedSettings.textFont
HealthText.Color = ParseColor(self, Options.healthTextColor[1], false)
HealthText.Transparency = Options.healthTextColor[2]
HealthText.Outline = Options.healthTextOutline
HealthText.OutlineColor = ParseColor(self, Options.healthTextOutlineColor, true)
HealthText.Position = Lerp2(BarTo, BarFrom, self.Health / self.MaxHealth)
- HealthText.TextBounds * 0.5
- HEALTH_TEXT_OFFSET
end
Visible.Name.Visible = Enabled and OnScreen and Options.name
if Visible.Name.Visible then
local Name = Visible.Name
Name.Size = Interface.sharedSettings.textSize
Name.Font = Interface.sharedSettings.textFont
Name.Color = ParseColor(self, Options.nameColor[1], false)
Name.Transparency = Options.nameColor[2]
Name.Outline = Options.nameOutline
Name.OutlineColor = ParseColor(self, Options.nameOutlineColor, true)
Name.Position = (Corners.TopLeft + Corners.TopRight) * 0.5 - Vector2.yAxis * Name.TextBounds.Y - NAME_OFFSET
end
Visible.Distance.Visible = Enabled and OnScreen and self.Distance and Options.distance
if Visible.Distance.Visible then
local Distance = Visible.Distance
Distance.Text = Round(self.Distance) .. " studs"
Distance.Size = Interface.sharedSettings.textSize
Distance.Font = Interface.sharedSettings.textFont
Distance.Color = ParseColor(self, Options.distanceColor[1], false)
Distance.Transparency = Options.distanceColor[2]
Distance.Outline = Options.distanceOutline
Distance.OutlineColor = ParseColor(self, Options.distanceOutlineColor, true)
Distance.Position = (Corners.BottomLeft + Corners.BottomRight) * 0.5 + DISTANCE_OFFSET
end
Visible.Weapon.Visible = Enabled and OnScreen and Options.weapon
if Visible.Weapon.Visible then
local Weapon = Visible.Weapon
Weapon.Text = self.Weapon
Weapon.Size = Interface.sharedSettings.textSize
Weapon.Font = Interface.sharedSettings.textFont
Weapon.Color = ParseColor(self, Options.weaponColor[1], false)
Weapon.Transparency = Options.weaponColor[2]
Weapon.Outline = Options.weaponOutline
Weapon.OutlineColor = ParseColor(self, Options.weaponOutlineColor, true)
Weapon.Position = (Corners.BottomLeft + Corners.BottomRight) * 0.5
+ (
Visible.Distance.Visible and DISTANCE_OFFSET + Vector2.yAxis * Visible.Distance.TextBounds.Y
or Vector2.zero
)
end
Visible.Tracer.Visible = Enabled and OnScreen and Options.tracer
Visible.TracerOutline.Visible = Visible.Tracer.Visible and Options.tracerOutline
if Visible.Tracer.Visible then
local Tracer = Visible.Tracer
Tracer.Color = ParseColor(self, Options.tracerColor[1], false)
Tracer.Transparency = Options.tracerColor[2]
Tracer.To = (Corners.BottomLeft + Corners.BottomRight) * 0.5
Tracer.From = Options.tracerOrigin == "Middle" and ViewportSize * 0.5
or Options.tracerOrigin == "Top" and ViewportSize * Vector2.new(0.5, 0)
or Options.tracerOrigin == "Bottom" and ViewportSize * Vector2.new(0.5, 1)
local TracerOutline = Visible.TracerOutline
TracerOutline.Color = ParseColor(self, Options.tracerOutlineColor[1], true)
TracerOutline.Transparency = Options.tracerOutlineColor[2]
TracerOutline.To = Tracer.To
TracerOutline.From = Tracer.From
end
Hidden.Arrow.Visible = Enabled and not OnScreen and Options.offScreenArrow
Hidden.ArrowOutline.Visible = Hidden.Arrow.Visible and Options.offScreenArrowOutline
if Hidden.Arrow.Visible and self.Direction then
local Arrow = Hidden.Arrow
Arrow.PointA = Min2(
Max2(ViewportSize * 0.5 + self.Direction * Options.offScreenArrowRadius, Vector2.one * 25),
ViewportSize - Vector2.one * 25
)
Arrow.PointB = Arrow.PointA - RotateVector(self.Direction, 0.45) * Options.offScreenArrowSize
Arrow.PointC = Arrow.PointA - RotateVector(self.Direction, -0.45) * Options.offScreenArrowSize
Arrow.Color = ParseColor(self, Options.offScreenArrowColor[1], false)
Arrow.Transparency = Options.offScreenArrowColor[2]
local ArrowOutline = Hidden.ArrowOutline
ArrowOutline.PointA = Arrow.PointA
ArrowOutline.PointB = Arrow.PointB
ArrowOutline.PointC = Arrow.PointC
ArrowOutline.Color = ParseColor(self, Options.offScreenArrowOutlineColor[1], true)
ArrowOutline.Transparency = Options.offScreenArrowOutlineColor[2]
end
local Box3dEnabled = Enabled and OnScreen and Options.box3d
for i = 1, #Box3d do
local Face = Box3d[i]
for i2 = 1, #Face do
local Line = Face[i2]
Line.Visible = Box3dEnabled
Line.Color = ParseColor(self, Options.box3dColor[1], false)
Line.Transparency = Options.box3dColor[2]
end
if Box3dEnabled then
local Line1 = Face[1]
Line1.From = Corners.Corners[i]
Line1.To = Corners.Corners[i == 4 and 1 or i + 1]
local Line2 = Face[2]
Line2.From = Corners.Corners[i == 4 and 1 or i + 1]
Line2.To = Corners.Corners[i == 4 and 5 or i + 5]
local Line3 = Face[3]
Line3.From = Corners.Corners[i == 4 and 5 or i + 5]
Line3.To = Corners.Corners[i == 4 and 8 or i + 4]
end
end
self.KirkImage.Visible = Enabled and OnScreen and Options.kirkEsp
if self.KirkImage.Visible then
local Img = self.KirkImage
local Scale = Options.kirkScale or 0.96
local Padding = (1 - Scale) * 0.5
local BoxPos = Corners.TopLeft
local BoxSize = Corners.BottomRight - Corners.TopLeft
local FinalPos = BoxPos + BoxSize * Vector2.new(Padding, Padding)
local FinalSize = BoxSize * Scale
Img.Position = UDim2.fromOffset(FinalPos.X, FinalPos.Y)
Img.Size = UDim2.fromOffset(FinalSize.X, FinalSize.Y)
Img.ImageTransparency = 1 - (Options.kirkTransparency or 1)
if Options.kirkBackground then
local BgColor = ParseColor(self, Options.kirkBackgroundColor[1], false)
Img.BackgroundColor3 = BgColor
Img.BackgroundTransparency = Options.kirkBackgroundColor[2]
else
Img.BackgroundTransparency = 1
end
Interface.GetKirkRole = function(TargetPlayer: Player)
local Character = Interface.GetCharacter(TargetPlayer)
if not Character then
return "default"
end
local Parent = Character.Parent
if not Parent then
return "default"
end
if Parent.Name == "Killers" then
return "killer"
end
if Parent.Name == "Survivors" then
return "survivor"
end
return "default"
end
local Role = (Interface.GetKirkRole and Interface.GetKirkRole(self.Player)) or "default"
local CharName = (self.Character and self.Character.Name) or self.Player.Name
Img.Image = GetKirkAsset(Role, CharName) or ""
end
local IconBillboard = self.IconBillboard
local CharIcon = self.CharacterIcon
local DeviceIcon = self.DeviceIcon
IconBillboard.Enabled = Enabled and (Options.characterIcon or Options.deviceIcon)
if IconBillboard.Enabled then
local Size = Options.iconSize or 40
local Transparency = 1 - (Options.iconOpacity or 1)
CharIcon.Size = UDim2.fromOffset(Size, Size)
DeviceIcon.Size = UDim2.fromOffset(Size, Size)
CharIcon.ImageTransparency = Transparency
DeviceIcon.ImageTransparency = Transparency
if Options.characterIcon then
local CharacterName = nil
local PlayerData = self.Player:FindFirstChild("PlayerData")
local Equipped = PlayerData and PlayerData:FindFirstChild("Equipped")
if Equipped and self.Character and self.Character.Parent then
if self.Character.Parent.Name == "Killers" then
local Val = Equipped:FindFirstChild("Killer")
if Val and type(Val.Value) == "string" then
CharacterName = Val.Value
end
elseif self.Character.Parent.Name == "Survivors" then
local Val = Equipped:FindFirstChild("Survivor")
if Val and type(Val.Value) == "string" then
CharacterName = Val.Value
end
end
end
if CharacterName and type(CharacterIcons) == "table" and type(CharacterIcons[CharacterName]) == "string" then
CharIcon.Image = CharacterIcons[CharacterName]
CharIcon.Visible = true
else
CharIcon.Visible = false
end
else
CharIcon.Visible = false
end
if Options.deviceIcon then
local Device = self.Player:GetAttribute("Device")
if Device and type(DeviceIcons) == "table" and type(DeviceIcons[Device]) == "string" then
DeviceIcon.Image = DeviceIcons[Device]
DeviceIcon.Visible = true
else
DeviceIcon.Visible = false
end
else
DeviceIcon.Visible = false
end
end
end
local ChamObject = {}
ChamObject.__index = ChamObject
function ChamObject.New(Player: Player, Interface: table)
local Self = setmetatable({}, ChamObject)
Self.Player = assert(Player, "Missing argument #1 (Player expected)")
Self.Interface = assert(Interface, "Missing argument #2 (table expected)")
for _, HL in pairs(Workspace:GetChildren()) do
if HL:IsA("Highlight") then
HL:Destroy()
end
end
Self:Construct()
return Self
end
function ChamObject:Construct()
self.Highlight = Instance.new("Highlight", Container)
self.UpdateConnection = RS.Heartbeat:Connect(function()
self:Update()
end)
end
function ChamObject:Destruct()
self.UpdateConnection:Disconnect()
self.Highlight:Destroy()
Clear(self)
end
function ChamObject:Update()
local Highlight = self.Highlight
local Interface = self.Interface
local Character = Interface.GetCharacter(self.Player)
local Options = Interface.teamSettings[Interface.IsFriendly(self.Player) and "friendly" or "enemy"]
local Enabled = Options.enabled
and Character
and not (#Interface.whitelist > 0 and not Find(Interface.whitelist, self.Player.UserId))
Highlight.Enabled = Enabled and Options.chams
if Highlight.Enabled then
Highlight.Adornee = Character
Highlight.FillColor = ParseColor(self, Options.chamsFillColor[1], false)
Highlight.FillTransparency = Options.chamsFillColor[2]
Highlight.OutlineColor = ParseColor(self, Options.chamsOutlineColor[1], true)
Highlight.OutlineTransparency = Options.chamsOutlineColor[2]
Highlight.DepthMode = Options.chamsVisibleOnly and "Occluded" or "AlwaysOnTop"
end
end
local SkeletonObject = {}
SkeletonObject.__index = SkeletonObject
function SkeletonObject.New(Player: Player, Interface: table)
local Self = setmetatable({}, SkeletonObject)
Self.Player = assert(Player, "Missing argument #1 (Player expected)")
Self.Interface = assert(Interface, "Missing argument #2 (table expected)")
Self.Bindings = {}
Self.Character = nil
Self.UpdateConnection = RS.Heartbeat:Connect(function()
Self:Update()
end)
return Self
end
function SkeletonObject:Destruct()
self.UpdateConnection:Disconnect()
for Overlay in next, self.Bindings do
if Overlay.Parent then
Overlay:Destroy()
end
self.Bindings[Overlay] = nil
end
self.Character = nil
end
function SkeletonObject:Rebuild()
for Overlay in next, self.Bindings do
if Overlay.Parent then
Overlay:Destroy()
end
self.Bindings[Overlay] = nil
end
local Interface = self.Interface
local Character = Interface.GetCharacter(self.Player)
if not Character then
self.Character = nil
return
end
self.Character = Character
for _, Source in ipairs(SkeletonSource:GetChildren()) do
if IsA(Source, "BasePart") then
local Target = FindFirstChild(Character, Source.Name)
if Target and IsA(Target, "BasePart") then
local Overlay = Source:Clone()
Overlay.Anchored = true
Overlay.CanCollide = false
Overlay.CastShadow = false
Overlay.Parent = SkeletonWorld
self.Bindings[Overlay] = Target
end
end
end
end
function SkeletonObject:Update()
local Interface = self.Interface
local Character = Interface.GetCharacter(self.Player)
local Options = Interface.teamSettings[Interface.IsFriendly(self.Player) and "friendly" or "enemy"]
local Enabled = Options.enabled
and Options.skeleton
and Character
and not (#Interface.whitelist > 0 and not Find(Interface.whitelist, self.Player.UserId))
local CurrentCamera = Workspace.CurrentCamera
if CurrentCamera then
Camera = CurrentCamera
ViewportSize = Camera.ViewportSize
SkeletonCamera.CFrame = Camera.CFrame
SkeletonCamera.FieldOfView = Camera.FieldOfView
end
if not Enabled then
for Overlay in next, self.Bindings do
Overlay.Transparency = 1
end
if Character ~= self.Character then
self:Rebuild()
end
return
end
if Character ~= self.Character or not next(self.Bindings) then
self:Rebuild()
end
local Color = ParseColor(self, Options.skeletonColor[1], false)
local Transparency = Options.skeletonColor[2]
for Overlay, Limb in next, self.Bindings do
if not Limb or not Limb.Parent then
if Overlay.Parent then
Overlay:Destroy()
end
self.Bindings[Overlay] = nil
else
Overlay.CFrame = Limb.CFrame
Overlay.Transparency = Transparency
local TargetMesh = Overlay:FindFirstChild("Mesh")
if not TargetMesh then
TargetMesh = Overlay:FindFirstChildWhichIsA("DataModelMesh")
end
if TargetMesh then
TargetMesh.VertexColor = Vector3.new(Color.R, Color.G, Color.B)
else
Overlay.Color = Color
end
end
end
end
local InstanceObject = {}
InstanceObject.__index = InstanceObject
function InstanceObject.New(TargetInstance: Instance, Options: table)
local Self = setmetatable({}, InstanceObject)
Self.Instance = assert(TargetInstance, "Missing argument #1 (Instance Expected)")
Self.Options = assert(Options, "Missing argument #2 (table expected)")
Self:Construct()
return Self
end
function InstanceObject:Construct()
local Options = self.Options
Options.enabled = Options.enabled == nil and true or Options.enabled
Options.text = Options.text or "{name}"
Options.textColor = Options.textColor or { Color3.new(1, 1, 1), 1 }
Options.textOutline = Options.textOutline == nil and true or Options.textOutline
Options.textOutlineColor = Options.textOutlineColor or Color3.new()
Options.textSize = Options.textSize or 13
Options.textFont = Options.textFont or 2