-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclutch.lua
More file actions
3237 lines (2726 loc) · 118 KB
/
clutch.lua
File metadata and controls
3237 lines (2726 loc) · 118 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
if game.GameId ~= 2440500124 then return end -- Universe ID
if identifyexecutor and identifyexecutor():gsub(" ", "") == "Solara" then
loadstring(game:HttpGet("https://raw.githubusercontent.com/deividcomsono/Scripts/main/clutch-solara.lua"))()
return
end
local cloneref = cloneref or function(o) return o end
local function GetService(name)
return cloneref(game:GetService(name))
end
local Lighting = GetService("Lighting")
local PathfindingService = GetService("PathfindingService")
local Players = GetService("Players")
local ProximityPromptService = GetService("ProximityPromptService")
local ReplicatedStorage = GetService("ReplicatedStorage")
local RunService = GetService("RunService")
local SoundService = GetService("SoundService")
local TextChatService = GetService("TextChatService")
local UserInputService = GetService("UserInputService")
local Midnight, Flags = loadstring(game:HttpGet("https://raw.githubusercontent.com/deividcomsono/Midnight/main/Source.lua"))()
local Console = loadstring(game:HttpGet("https://raw.githubusercontent.com/notpoiu/Scripts/main/utils/console/main.lua"))() -- Made by Upio
local message = Console.custom_console_progressbar({
msg = "[clutch.lua]: Loading...",
img = "",
clr = Color3.fromRGB(255, 255, 255),
length = 5
})
if not game:IsLoaded() then
game.Loaded:Wait(1)
end
if Players.LocalPlayer.PlayerGui:FindFirstChild("LoadingUI") and Players.LocalPlayer.PlayerGui.LoadingUI.Enabled then
Midnight:Notify("Waiting for the game to load...", 3)
repeat
task.wait()
until not Players.LocalPlayer.PlayerGui.LoadingUI.Enabled
end
message.update_message_with_progress("[clutch.lua]: Creating variables...", 1)
-- #region Variables --
local RBXGeneral: TextChannel = TextChatService.TextChannels.RBXGeneral
local originalHook
local connections = {}
local objects = {}
local tracks = {}
local espTable = {
["Door"] = {},
["Entity"] = {},
["Objective"] = {},
["Item"] = {},
["Gold"] = {},
["Player"] = {},
["NoType"] = {},
}
local entitiesTable = {
["Entities"] = {
"BackdoorRush", "BackdoorLookman", "RushMoving", "AmbushMoving", "Eyes", "Screech", "Halt", "JeffTheKiller", "A60", "A120"
},
["Names"] = {
["BackdoorRush"] = "Blitz",
["BackdoorLookman"] = "Lookman",
["RushMoving"] = "Rush",
["AmbushMoving"] = "Ambush",
["JeffTheKiller"] = "Jeff The Killer"
}
}
local itemsTable = {
["Names"] = {
["CrucifixWall"] = "Crucifix"
}
}
local promptTable = {
["Aura"] = {
["ActivateEventPrompt"] = false,
["HerbPrompt"] = true,
["LootPrompt"] = false,
["ModulePrompt"] = true,
},
["AuraFools"] = {
["UnlockPrompt"] = false
},
["AuraPrompts"] = {},
["Clip"] = {
"HerbPrompt",
"HidePrompt",
"LootPrompt",
"ModulePrompt",
"SkullPrompt",
"UnlockPrompt",
"Prompt"
},
["ClipObjects"] = {
"LeverForGate",
"LiveHintBook",
"LiveBreakerPolePickup"
},
["Visible"] = {},
["Excluded"] = {
"HintPrompt",
"InteractPrompt"
}
}
local exitKeycodes = {
Enum.KeyCode.W,
Enum.KeyCode.A,
Enum.KeyCode.S,
Enum.KeyCode.D
}
local holdAnim = Instance.new("Animation"); holdAnim.AnimationId = "rbxassetid://10479585177"
local throwAnim = Instance.new("Animation"); throwAnim.AnimationId = "rbxassetid://10482563149"
local twerkAnim = Instance.new("Animation"); twerkAnim.AnimationId = "rbxassetid://12874447851"
local holdingObj
local holdingJeff
local throwingObj = false
local camera = workspace.CurrentCamera
local localPlayer = Players.LocalPlayer
local mouse = localPlayer:GetMouse()
local alive = localPlayer:GetAttribute("Alive")
local character = localPlayer.Character
local humanoid
local rootPart
local collision
local collisionClone
local playerGui = localPlayer.PlayerGui
local mainUI = playerGui:WaitForChild("MainUI")
local rawMainGame = mainUI:WaitForChild("Initiator"):WaitForChild("Main_Game")
local mainGame = require(rawMainGame)
local permUI = playerGui:WaitForChild("PermUI")
local hints = permUI:WaitForChild("Hints")
local mainSoundGroup = SoundService:WaitForChild("Main")
local jamSoundEffect = mainSoundGroup:WaitForChild("Jamming")
local entityModules = ReplicatedStorage:WaitForChild("ClientModules"):WaitForChild("EntityModules")
local gameData = ReplicatedStorage:WaitForChild("GameData")
local floor = gameData:WaitForChild("Floor")
local latestRoom = gameData:WaitForChild("LatestRoom")
local isBackdoor = floor.Value == "Backdoor"
local isHotel = floor.Value == "Hotel"
local isFools = floor.Value == "Fools"
local isRetro = floor.Value == "Retro"
local isRooms = floor.Value == "Rooms"
local liveModifiers = ReplicatedStorage:WaitForChild("LiveModifiers")
local remotesFolder = isFools and ReplicatedStorage:WaitForChild("EntityInfo") or ReplicatedStorage:WaitForChild("RemotesFolder")
local haltModule
local oldHaltStuff
local glitchModule
local oldGlitchStuff
-- Auto Doors ---
local charPos = alive and character:GetPivot() or CFrame.new()
local downOffset = -8
local lastYBeforeOpening = 0
local currentRoom
local currentDoor
local doorPos
local path = PathfindingService:CreatePath()
local waypoints
local nextWaypointIndex
-- End --
type ESP = {
Object: Instance,
Text: string,
Color: Color3,
Offset: Vector3,
IsEntity: boolean
}
-- #endregion --
message.update_message_with_progress("[clutch.lua]: Creating functions...", 2)
-- #region Functions --
function distanceFromCharacter(position)
if typeof(position) == "Instance" then
position = position:GetPivot().Position
end
if alive then
return (rootPart.Position - position).Magnitude
else
return (camera.CFrame.Position - position).Magnitude
end
return 9e9
end
-- Auto Doors --
function dragPlayer(pos) -- https://github.com/RegularVynixu/Utilities/blob/main/Doors%20Entity%20Spawner/Source.lua#L43 (credits to vynixu for function)
if not Flags["AutoPlay"].Value then return end
if Flags["AutoPlayPause"].Value and isEntitySpawned() then
repeat RunService.Heartbeat:Wait() until not isEntitySpawned()
end
if connections["MoveConnection"] then
connections["MoveConnection"]:Disconnect()
end
connections["MoveConnection"] = RunService.Stepped:Connect(function(_, deltaTime)
if character and rootPart then
local rootPos = rootPart.Position
local diff = Vector3.new(pos.X, pos.Y, pos.Z) - rootPos
if diff.Magnitude > 0.1 then
character:PivotTo(CFrame.new(rootPos + diff.Unit * math.min(deltaTime * Flags["AutoPlaySpeed"].Value, diff.Magnitude)))
else
charPos = character:GetPivot()
connections["MoveConnection"]:Disconnect()
end
end
end)
repeat
task.wait()
until not connections["MoveConnection"].Connected
end
local function followPath(destination)
local success, errorMessage = pcall(function()
path:ComputeAsync(character.PrimaryPart.Position, destination)
end)
if success and path.Status == Enum.PathStatus.Success then
waypoints = path:GetWaypoints()
connections["BlockedConnection"] = path.Blocked:Connect(function(blockedWaypointIndex)
if blockedWaypointIndex >= nextWaypointIndex then
connections["BlockedConnection"]:Disconnect()
followPath(destination)
end
end)
-- Detect when movement to next waypoint is complete
if not connections["ReachedConnection"] then
connections["ReachedConnection"] = humanoid.MoveToFinished:Connect(function(reached)
if reached and nextWaypointIndex < #waypoints then
nextWaypointIndex += 1
humanoid:MoveTo(waypoints[nextWaypointIndex].Position)
else
connections["ReachedConnection"]:Disconnect()
connections["BlockedConnection"]:Disconnect()
end
end)
end
-- Initially move to second waypoint (first waypoint is path start; skip it)
nextWaypointIndex = 2
humanoid:MoveTo(waypoints[nextWaypointIndex].Position)
else
warn("Path not computed!", errorMessage)
end
end
function firepp(prompt: ProximityPrompt, targetObj)
if not prompt:IsA("ProximityPrompt") then
return error("ProximityPrompt expected, got " .. typeof(prompt))
end
if prompt.HoldDuration == 0 then
return fireproximityprompt(prompt)
end
local originalEnabled = prompt.Enabled
local originalLineOfSight = prompt.RequiresLineOfSight
local originalCamCFrame = camera.CFrame
prompt.Enabled = true
prompt.RequiresLineOfSight = false
mainGame.crouch(false)
local objPos = Vector3.zero
local targetObj = targetObj or (prompt:FindFirstAncestorWhichIsA("Model") or prompt:FindFirstAncestorWhichIsA("BasePart"))
if targetObj then
objPos = (targetObj:IsA("Model") and targetObj:GetPivot().Position or targetObj.Position)
end
connections["PromptConnection"] = RunService.RenderStepped:Connect(function()
camera.CFrame = CFrame.new(camera.CFrame.Position, objPos)
end)
task.wait(0.1)
prompt:InputHoldEnd()
prompt:InputHoldBegin()
prompt.PromptButtonHoldEnded:Wait()
prompt:InputHoldEnd()
connections["PromptConnection"]:Disconnect()
camera.CFrame = originalCamCFrame
prompt.Enabled = originalEnabled
prompt.RequiresLineOfSight = originalLineOfSight
end
local function inCutscene(): boolean
return mainGame.stopcam or false
end
function isEntitySpawned(): boolean
local entity = workspace:FindFirstChild("RushMoving") or workspace:FindFirstChild("AmbushMoving")
if entity then
if not entity.PrimaryPart then
repeat
task.wait()
until entity.PrimaryPart or not entity:IsDescendantOf(workspace)
end
if entity and distanceFromCharacter(entity:GetPivot().Position) < 2000 then
return true
end
end
return false
end
--
function isEyesSpawned(): boolean
local eyes = nil
if not isBackdoor then
eyes = workspace:FindFirstChild("Eyes")
else
eyes = workspace:FindFirstChild("Lookman")
end
return eyes ~= nil
end
function enableBreaker(breaker, value)
breaker:SetAttribute("Enabled", value)
if value then
breaker:FindFirstChild("PrismaticConstraint", true).TargetPosition = -0.2
breaker.Light.Material = Enum.Material.Neon
breaker.Light.Attachment.Spark:Emit(1)
breaker.Sound.Pitch = 1.3
else
breaker:FindFirstChild("PrismaticConstraint", true).TargetPosition = 0.2
breaker.Light.Material = Enum.Material.Glass
breaker.Sound.Pitch = 1.2
end
breaker.Sound:Play()
end
function esp(params: ESP)
local EspManager = {
Type = params.Type or "NoType",
Object = params.Object,
Text = params.Text or "No Text",
TextParent = params.TextParent or nil,
Color = params.Color or Color3.new(0, 0, 0),
Offset = params.Offset or Vector3.zero,
IsEntity = params.IsEntity or false,
rsConnection = nil
}
local tableIndex = #espTable[EspManager.Type] + 1
local traceDrawing = Drawing.new("Line") do
traceDrawing.Visible = false
traceDrawing.Color = EspManager.Color
traceDrawing.Thickness = 1
end
if EspManager.Object and EspManager.IsEntity and EspManager.Object.PrimaryPart.Transparency == 1 then
EspManager.Object:SetAttribute("OldTransparency", EspManager.Object.PrimaryPart.Transparency)
Instance.new("Humanoid", EspManager.Object)
EspManager.Object.PrimaryPart.Transparency = 0.99
end
local highlight = Instance.new("Highlight") do
highlight.Adornee = EspManager.Object
highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
highlight.FillColor = EspManager.Color
highlight.FillTransparency = Flags["ESPFillTransparency"].Value
highlight.OutlineColor = EspManager.Color
highlight.OutlineTransparency = Flags["ESPOutlineTransparency"].Value
highlight.Parent = EspManager.Object
end
local billboardGui = Instance.new("BillboardGui") do
billboardGui.Adornee = EspManager.TextParent or EspManager.Object
billboardGui.AlwaysOnTop = true
billboardGui.ClipsDescendants = false
billboardGui.Size = UDim2.new(0, 1, 0, 1)
billboardGui.StudsOffset = EspManager.Offset
billboardGui.Parent = EspManager.TextParent or EspManager.Object
end
local textLabel = Instance.new("TextLabel") do
textLabel.BackgroundTransparency = 1
textLabel.Font = Enum.Font.Oswald
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = EspManager.Text
textLabel.TextColor3 = EspManager.Color
textLabel.TextSize = Flags["ESPTextSize"].Value
textLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
textLabel.TextStrokeTransparency = 0.75
textLabel.Parent = billboardGui
end
function EspManager:SetColor(newColor: Color3)
EspManager.Color = newColor
highlight.FillColor = newColor
highlight.OutlineColor = newColor
textLabel.TextColor3 = newColor
if traceDrawing then
traceDrawing.Color = newColor
end
end
function EspManager.Delete()
if EspManager.rsConnection then
EspManager.rsConnection:Disconnect()
end
if EspManager.IsEntity and EspManager.Object and (EspManager.Object:IsA("Model") and EspManager.Object.PrimaryPart) then
EspManager.Object.PrimaryPart.Transparency = EspManager.Object:GetAttribute("OldTransparency")
end
traceDrawing:Destroy()
highlight:Destroy()
billboardGui:Destroy()
if espTable[EspManager.Type][tableIndex] then
espTable[EspManager.Type][tableIndex] = nil
end
end
EspManager.rsConnection = RunService.RenderStepped:Connect(function()
if not EspManager.Object or not EspManager.Object:IsDescendantOf(workspace) or not (EspManager.Object:IsA("Model") and EspManager.Object:GetPivot().Position or EspManager.Object:IsA("BasePart") and EspManager.Object.Position) then
EspManager.Delete()
return
end
highlight.FillTransparency = Flags["ESPFillTransparency"].Value
highlight.OutlineTransparency = Flags["ESPOutlineTransparency"].Value
textLabel.TextSize = Flags["ESPTextSize"].Value
if rawMainGame and rawMainGame:FindFirstChild("PromptService") then
local promptHighlight = rawMainGame.PromptService.Highlight
if promptHighlight and promptHighlight.Adornee and (promptHighlight.Adornee == EspManager.Object or promptHighlight.Adornee.Parent == EspManager.Object.Parent) then
promptHighlight.Adornee = nil
end
end
if Flags["ESPShowDistance"].Value then
textLabel.Text = string.format("%s\n[%s]", EspManager.Text, math.ceil(distanceFromCharacter(EspManager.Object:IsA("Model") and EspManager.Object:GetPivot().Position or EspManager.Object:IsA("BasePart") and EspManager.Object.Position)))
else
textLabel.Text = EspManager.Text
end
if Flags["ESPShowTracers"].Value then
local vector, onScreen = camera:WorldToViewportPoint(EspManager.Object:IsA("Model") and EspManager.Object:GetPivot().Position or EspManager.Object:IsA("BasePart") and EspManager.Object.Position)
if onScreen then
traceDrawing.From = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 1)
traceDrawing.To = Vector2.new(vector.X, vector.Y)
traceDrawing.Visible = true
else
traceDrawing.Visible = false
end
else
traceDrawing.Visible = false
end
end)
espTable[EspManager.Type][tableIndex] = EspManager
return EspManager
end
function addDoorEsp(room)
local door = room:WaitForChild("Door")
local locked = room:GetAttribute("RequiresKey")
local isLibrary = room.Name == "49" or room.Name == "50"
if door and door:GetAttribute("Opened") ~= true then
local doorEsp = esp({
Type = "Door",
Object = ((isHotel or isFools) and isLibrary) and door or door:WaitForChild("Door"),
Text = locked and string.format("Door %s [Locked]", room.Name + 1) or string.format("Door %s", room.Name + 1),
Color = Flags["DoorESPColor"].Color
})
door:GetAttributeChangedSignal("Opened"):Connect(function()
local value = door:GetAttribute("Opened")
if doorEsp and value then doorEsp.Delete() end
end)
end
end
function addEntityEsp(entity)
local entityName = getEntityName(entity)
local entityEsp = esp({
Type = "Entity",
Object = entity,
Text = entityName,
TextParent = entity.Name == "JeffTheKiller" and entity.PrimaryPart or nil,
Color = Flags["EntityESPColor"].Color,
Offset = Vector3.new(0, 4, 0),
IsEntity = entity.Name ~= "JeffTheKiller" and true or false
})
if entityName == "Eyes" then
entity.PrimaryPart:WaitForChild("Ambience"):GetPropertyChangedSignal("Playing"):Connect(function()
if not entity.PrimaryPart.Ambience.Playing then
entityEsp.Delete()
end
end)
task.delay(3, function()
if not entity.PrimaryPart.Ambience.Playing then
entityEsp.Delete()
end
end)
end
end
function addObjectiveEsp(room)
task.spawn(function()
if not room:WaitForChild("Assets", 3) then return end
if room:GetAttribute("RequiresKey") then
local key = room:FindFirstChild("KeyObtain", true)
if key then
esp({
Type = "Objective",
Object = key,
Text = "Key",
Color = Flags["ObjectiveESPColor"].Color
})
end
end
if room.Assets:FindFirstChild("LeverForGate") then
local lever = room.Assets.LeverForGate
local esp = esp({
Type = "Objective",
Object = lever,
Text = "Lever",
Color = Flags["ObjectiveESPColor"].Color
})
lever.PrimaryPart:WaitForChild("SoundToPlay").Played:Connect(function()
esp.Delete()
end)
elseif room.Name == "100" then
local key = room.Assets:WaitForChild("ElectricalKeyObtain", 5)
if key then
esp({
Type = "Objective",
Object = key,
Text = "Key",
Color = Flags["ObjectiveESPColor"].Color
})
end
end
end)
end
function addItemEsp(item, drop)
local itemName = itemsTable.Names[item.Name] or item.Name
esp({
Type = drop and "ItemDrop" or "Item",
Object = item,
Text = itemName,
Color = Flags["ItemESPColor"].Color
})
end
function addGoldEsp(gold)
esp({
Type = "Gold",
Object = gold,
Text = string.format("Gold Pile [%s]", gold:GetAttribute("GoldValue")),
Color = Flags["GoldESPColor"].Color
})
end
function addPlayerEsp(player)
if player.Character.Humanoid.Health == 0 then return end
local playerEsp = esp({
Type = "Player",
Object = player.Character,
Text = string.format("%s [%s]", player.DisplayName, player.Character.Humanoid.Health),
TextParent = player.Character:FindFirstChild("HumanoidRootPart"),
Color = Flags["PlayerESPColor"].Color,
})
player.Character.Humanoid.HealthChanged:Connect(function(newHealth)
if newHealth > 0 then
playerEsp.Text = string.format("%s [%s]", player.DisplayName, newHealth)
else
playerEsp.Delete()
end
end)
end
function addRoomEsp(room)
task.spawn(function()
if Flags["ESPWhat"].Value.Door then
addDoorEsp(room)
end
if Flags["ESPWhat"].Value.Objective then
task.delay(room.Name == "50" and 3 or 1, addObjectiveEsp, room)
end
end)
end
function addRoomConnection(room)
room.DescendantAdded:Connect(function(child)
if child:IsA("BasePart") and (child.Parent and child.Parent.Name == "TriggerEventCollision" and child.Name == "Collision") then
if #Players:GetPlayers() > 1 and Flags["FEAntiSeek"].Value and rootPart then
local currentRoom = latestRoom.Value + 1
task.spawn(function()
repeat
firetouchtransmitter(child, rootPart, 1)
task.wait()
firetouchtransmitter(child, rootPart, 0)
until not child or latestRoom.Value > currentRoom
end)
elseif Flags["AntiSeek"].Value then
child.CanTouch = false
end
end
task.delay(0, function()
if child:IsA("ProximityPrompt") then
if promptTable.Aura[child.Name] ~= nil and not child:FindFirstAncestor("Padlock") and not (isFools and child:FindFirstAncestor("KeyObtainFake")) and not (isRetro and child:FindFirstAncestor("RetroWardrobe")) then
table.insert(promptTable.AuraPrompts, child)
end
if isFools and promptTable.AuraFools[child.Name] ~= nil then
table.insert(promptTable.AuraPrompts, child)
end
end
end)
task.delay(0.1, function()
if child:IsDescendantOf(workspace) and child:IsA("ProximityPrompt") then
if not table.find(promptTable.Excluded, child.Name) then
if not child:GetAttribute("OriginalDistance") then
child:SetAttribute("OriginalDistance", child.MaxActivationDistance)
end
if not child:GetAttribute("OriginalEnabled") then
child:SetAttribute("OriginalEnabled", child.Enabled)
end
if not child:GetAttribute("OriginalClip") then
child:SetAttribute("OriginalClip", child.RequiresLineOfSight)
end
child.MaxActivationDistance = child:GetAttribute("OriginalDistance") * Flags["PromptRangeBoost"].Value
if isFools and Flags["InstaInteract"].Value then
if not child:GetAttribute("OriginalDuration") then
child:SetAttribute("OriginalDuration", child.HoldDuration)
end
child.HoldDuration = 0
end
if child:IsDescendantOf(workspace) and Flags["PromptClip"].Value and (table.find(promptTable.Clip, child.Name) or table.find(promptTable.ClipObjects, child.Parent.Name)) then
child.Enabled = true
child.RequiresLineOfSight = false
if child.Name == "ModulePrompt" then
child:GetPropertyChangedSignal("Enabled"):Connect(function()
if Flags["PromptClip"].Value then
child.Enabled = true
end
end)
end
end
end
end
if inCutscene() and child.Name == "ElevatorBreaker" and Flags["AutoBreakerBox"].Value then
local autoConnections = {}
local using = false
if not child:GetAttribute("DreadReaction") then
child:SetAttribute("DreadReaction", true)
using = true
if not (child:WaitForChild("SurfaceGui", 5) and child.SurfaceGui:WaitForChild("Frame", 5)) then return warn("Could not find elevator breaker gui") end
local code = child.SurfaceGui.Frame:WaitForChild("Code", 5)
local breakers = {}
for _, breaker in pairs(child:GetChildren()) do
if breaker.Name == "BreakerSwitch" then
local id = string.format("%02d", breaker:GetAttribute("ID"))
breakers[id] = breaker
end
end
if code and code:FindFirstChild("Frame") then
local correct = child.Box.Correct
local used = {}
autoConnections["Reset"] = correct:GetPropertyChangedSignal("Playing"):Connect(function()
if correct.Playing then
table.clear(used)
end
end)
autoConnections["Code"] = code:GetPropertyChangedSignal("Text"):Connect(function()
task.wait(0.1)
local newCode = code.Text
local isEnabled = code.Frame.BackgroundTransparency == 0
local breaker = breakers[newCode]
if newCode == "??" and #used == 9 then
for i = 1, 10 do
local id = string.format("%02d", i)
if not table.find(used, id) then
breaker = breakers[id]
end
end
end
if breaker then
table.insert(used, newCode)
if breaker:GetAttribute("Enabled") ~= isEnabled then
enableBreaker(breaker, isEnabled)
end
end
end)
end
repeat
task.wait()
until not child or not mainGame.stopcam or not Flags["AutoBreakerBox"].Value or not using
if child then child:SetAttribute("DreadReaction", nil) end
end
for _, connection in pairs(autoConnections) do
connection:Disconnect()
end
end
if child.Name == "ScaryHaltCollision" and Flags["NotifyEntities"].Value["Halt"] then
Midnight:Notify("Halt will spawn on next room!")
end
if Flags["ESPWhat"].Value.Entity then
if child.Name == "FigureRagdoll" then
esp({
Type = "Entity",
Object = child,
Text = "Figure",
Color = Flags["EntityESPColor"].Color
})
elseif child.Name == "Snare" then
esp({
Type = "Entity",
Object = child,
Text = "Snare",
Color = Flags["EntityESPColor"].Color
})
end
end
if Flags["ESPWhat"].Value.Objective then
if child.Name == "LiveHintBook" then
esp({
Type = "Objective",
Object = child,
Text = "Book",
Color = Flags["ObjectiveESPColor"].Color
})
elseif child.Name == "LiveBreakerPolePickup" then
esp({
Type = "Objective",
Object = child,
Text = "Breaker",
Color = Flags["ObjectiveESPColor"].Color
})
end
end
if Flags["ESPWhat"].Value.Gold then
if child.Name == "GoldPile" then
addGoldEsp(child)
end
end
if child:IsA("Model") and (child:GetAttribute("Pickup") or child:GetAttribute("PropType")) and not child:GetAttribute("JeffShop") then
if child.Parent.Name == "Assets" and child.Parent.Parent:FindFirstChild("Green_Herb") then return end
local itemName = itemsTable.Names[child.Name] or child.Name
if Flags["ESPWhat"].Value.Item then
addItemEsp(child)
end
if Flags["NotifyItems"].Value then
Midnight:Notify(Flags["ItemChatMessage"].Text:gsub("{item}", itemName))
if Flags["ChatNotify"].Value then
RBXGeneral:SendAsync(Flags["ItemChatMessage"].Text:gsub("{item}", itemName))
end
end
end
if isRetro then
if child.Name == "Lava" and Flags["AntiLava"].Value then
child.CanTouch = false
end
end
if Flags["AntiObstructions"].Value then
if child.Name == "HurtPart" then
child.CanTouch = false
elseif child.Name == "AnimatorPart" then
child.CanTouch = false
end
end
if Flags["AntiDupe"].Value and child.Name == "DoorFake" and child.Parent.Name:match("Closet") then
disableDupe(child.Parent, true)
end
if Flags["AntiSnare"].Value and child.Name == "Snare" then
child:WaitForChild("Hitbox", 5).CanTouch = false
end
end)
end)
task.delay(0.1, function()
if room.Name == "50" and Flags["DeleteFigure"].Value then
local figureSetup = room:WaitForChild("FigureSetup", 5)
if figureSetup then
local figure = figureSetup:WaitForChild("FigureRagdoll", 5)
if figure and figure:WaitForChild("Root", 1) then
Midnight:Notify("Trying to delete figure...")
for _, part in pairs(figure:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = false
end
end
repeat
figure:PivotTo(figure.PrimaryPart.CFrame * CFrame.new(0, -1000, 0))
task.wait()
until not figure or latestRoom.Value > 49
if not figure then
Midnight:Notify("Figure has been deleted")
end
end
end
end
end)
end
function disableDupe(closet, value)
local doorFake = closet:WaitForChild("DoorFake", 5)
if doorFake then
doorFake:WaitForChild("Hidden", 5).CanTouch = not value
local lock = doorFake:WaitForChild("LockPart", 5)
if lock and lock:FindFirstChild("UnlockPrompt") then
lock.UnlockPrompt.Enabled = not value
end
end
end
function ghostPart(part)
if Flags["GhostBody"].Value then
part.LocalTransparencyModifier = Flags["BodyTransparency"].Value
end
end
function ghostPlayer(character)
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
ghostPart(part)
part:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
ghostPart(part)
end)
end
end
end
function setupCharacterConnection(newCharacter, reloading)
if not newCharacter then return warn("Invalid character") end
character = newCharacter
local bodyVelocity = Instance.new("BodyVelocity") do
bodyVelocity.Velocity = Vector3.new(0, 0, 0)
bodyVelocity.MaxForce = Vector3.new(9e9, 9e9, 9e9)
end
objects.bodyVelocity = bodyVelocity
task.spawn(ghostPlayer, character)
connections["CharacterChildAdded"] = character.ChildAdded:Connect(function(child)
if child:IsA("BasePart") and child.Name ~= "HumanoidRootPart" then
ghostPart(child)
child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
ghostPart(child)
end)
end
if child:IsA("Tool") and child.Name:match("LibraryHintPaper") then
task.wait()
local code = table.concat(getPadlockCode(child))
local output, count = code:gsub("_", "x")
if Flags["AutoPadlock"].Value and tonumber(code) then
remotesFolder.PL:FireServer(code)
end
if count < 5 then
if Flags["NotifyPadlockCode"].Value then
Midnight:Notify(string.format("The padlock code is: %s", output))
end
end
end
end)
connections["CharacterHiding"] = character:GetAttributeChangedSignal("LastHid"):Connect(function()
lastHidden = character:GetAttribute("Hiding") and workspace:GetServerTimeNow() or 0
end)
humanoid = character:WaitForChild("Humanoid", 3)
if humanoid then
if humanoid.Health > 0 then
task.delay(1, function()
tracks.holdingObjTrack = humanoid:LoadAnimation(holdAnim)
tracks.throwObjTrack = humanoid:LoadAnimation(throwAnim)
tracks.twerkTrack = humanoid:LoadAnimation(twerkAnim)
if Flags["Twerk"].Value then
tracks.twerkTrack:Play()
end
end)
end
connections["HumanoidDied"] = humanoid.Died:Connect(function()
if collisionClone then
collisionClone:Destroy()
end
end)
end
rootPart = character:WaitForChild("HumanoidRootPart", 3)
if rootPart then
if Flags["NoAcceleration"].Value then