-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path2016 mode
3486 lines (3058 loc) · 129 KB
/
2016 mode
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
pcall(
function()
loadstring(game:GetObjects("rbxassetid://15900013841")[1].Source)()
end
)
getgenv().config = {
old_console = true,
old_plist = true,
old_graphics = false,
dev = true
}
--// mods
getgenv().mods = {
fps_counter = false,
built_in_silentre = false,
c00l_mode = false
}
if not game:IsLoaded() then
game.Loaded:Wait()
end
wait(0.1)
--// variables/modules
local CoreGui = game:GetService("CoreGui")
local RobloxGui = CoreGui:FindFirstChild("RobloxGui")
local UserInputService = game:GetService("UserInputService")
local TopBar = game:GetService("CoreGui"):WaitForChild("TopBarApp"):WaitForChild("TopBarFrame")
local ChatIcon =
TopBar:WaitForChild("LeftFrame"):WaitForChild("ChatIcon"):WaitForChild("Background"):WaitForChild("Icon")
local UIS = game:GetService("UserInputService")
local function devprint(text)
if config.dev then
print(text)
end
end
--// custom assets
local getasset = getsynasset or getcustomasset
makefolder("2016_storage")
writefile(
"2016_storage/bc.png",
game:HttpGet(
"https://raw.githubusercontent.com/specowos/lua-projects/main/project%202016%3A%20Remastered/images/icon_BC-16.png"
)
)
writefile(
"2016_storage/tbc.png",
game:HttpGet(
"https://raw.githubusercontent.com/specowos/lua-projects/main/project%202016%3A%20Remastered/images/icon_TBC-16.png"
)
)
writefile(
"2016_storage/obc.png",
game:HttpGet(
"https://raw.githubusercontent.com/specowos/lua-projects/main/project%202016%3A%20Remastered/images/icon_OBC-16.png"
)
)
local bc_storage = {
getasset("2016_storage/bc.png"),
getasset("2016_storage/obc.png"),
getasset("2016_storage/tbc.png")
}
--// STYLE:
TopBar.Transparency = 0.5
TopBar.BorderSizePixel = 0
TopBar.BackgroundColor3 = Color3.fromRGB(31, 31, 31)
TopBar.LeftFrame.ChatIcon.Background.StateOverlay.Image = ""
TopBar.LeftFrame.MenuIcon.Background.StateOverlay.Image = ""
TopBar.LeftFrame.MenuIcon.Background.Image = ""
TopBar.LeftFrame.ChatIcon.Background.Image = ""
TopBar.LeftFrame.Position = UDim2.new(0, 0, 0, 2)
TopBar.LeftFrame.Size = UDim2.new(0, 0, 0, 36)
TopBar.LeftFrame.MenuIcon.Position = UDim2.new(0, 0, 0, 0)
TopBar.LeftFrame.MenuIcon.Size = UDim2.new(0, 50, 0, 36)
TopBar.LeftFrame.MenuIcon.Background.Icon.Position = UDim2.new(0, 25, 0, 12)
TopBar.LeftFrame.MenuIcon.Background.Icon.Size = UDim2.new(0, 32, 0, 25)
game.CoreGui:WaitForChild("TopBarApp").LegacyCloseMenu.CloseMenuButton.Position = UDim2.new(0, -8, 0, 18)
game.CoreGui:WaitForChild("TopBarApp").LegacyCloseMenu.CloseMenuButton.Size = UDim2.new(0, 32, 0, 25)
TopBar.LeftFrame.ChatIcon.Position = UDim2.new(0, 0, 0, 0)
TopBar.LeftFrame.ChatIcon.Size = UDim2.new(0, 50, 0, 36)
TopBar.LeftFrame.ChatIcon.Background.Icon.Position = UDim2.new(0, 14, 0, 13)
TopBar.LeftFrame.ChatIcon.Background.Icon.Size = UDim2.new(0, 28, 0, 27)
TopBar.LeftFrame.MenuIcon.Background.Icon.Image = "rbxasset://textures/ui/Menu/Hamburger.png"
--// FUNCTIONS:
--// old graphics
if config.old_graphics == true then
--// epic 2016 remastered--// instances
local cc = Instance.new("ColorCorrectionEffect")
local lighting = game:GetService("Lighting")
--// hd killer
local ihateu = {
"DepthOfFieldEffect",
"SunRaysEffect",
"BloomEffect",
"BlurEffect",
"ColorCorrectionEffect",
"Atmosphere"
}
for i, v in pairs(lighting:GetChildren()) do
for index, value in ipairs(ihateu) do
if v:IsA(value) then
v:Destroy()
end
end
end
--// setup
cc.Parent = game.Lighting
cc.Saturation = 0
cc.Contrast = -0.1
lighting.GlobalShadows = false
sethiddenproperty(lighting, "Technology", Enum.Technology.Compatibility)
settings().Rendering.QualityLevel = 14
devprint("loaded old graphics!")
end
--// thanks for most of the stud tex func beyond5d 😋
for _, v in ipairs(game:GetDescendants()) do
if v:IsA("BasePart") and v.Material == Enum.Material.Plastic and v.TopSurface == Enum.SurfaceType.Studs then
if not v:FindFirstChildOfClass("Texture") then
local Studs = Instance.new("Texture")
Studs.Parent = v
Studs.Face = Enum.NormalId.Top
Studs.Texture = "rbxassetid://7027211371"
Studs.Color3 = Color3.new(v.Color.R * 2, v.Color.G * 2, v.Color.B * 2)
Studs.Transparency = v.Transparency
end
end
end
--// fps mod *runs before health bar script
if mods.fps_counter then
local fps_counter = Instance.new("TextLabel")
fps_counter.Name = "fps_counter"
fps_counter.Parent = TopBar.RightFrame
fps_counter.BackgroundTransparency = 1
fps_counter.Size = UDim2.new(0, 35, 0, 32)
fps_counter.Font = Enum.Font.SourceSans
fps_counter.TextColor3 = Color3.fromRGB(255, 255, 255)
fps_counter.TextSize = 16.000
fps_counter.TextXAlignment = Enum.TextXAlignment.Right
local FPS = 0
local Tiempo = tick()
spawn(
function()
while game:GetService("RunService").RenderStepped:wait() do
local Transcurrido = math.abs(Tiempo - tick())
Tiempo = tick()
FPS = math.floor(1 / Transcurrido)
end
end
)
spawn(
function()
while wait(0.25) do
fps_counter.Text = "FPS: " .. tostring(FPS)
end
end
)
end
--// health bar scripts
TopBar.RightFrame.HealthBar:Destroy()
local NameHealthContainer = Instance.new("Frame")
local Username = Instance.new("TextLabel")
local HealthContainer = Instance.new("Frame")
local HealthFill = Instance.new("Frame")
NameHealthContainer.Name = "NameHealthContainer"
NameHealthContainer.Parent = game.CoreGui:WaitForChild("TopBarApp").TopBarFrame.RightFrame
NameHealthContainer.BackgroundTransparency = 1.000
NameHealthContainer.Position = UDim2.new(1, -170, 0.027778089, 0)
NameHealthContainer.Size = UDim2.new(0, 170, 1, 0)
NameHealthContainer.Active = false
Username.Name = "Username"
Username.Parent = NameHealthContainer
Username.BackgroundTransparency = 1.000
Username.Position = UDim2.new(0, 19, 0, 0)
Username.Size = UDim2.new(1, -14, 0, 22)
Username.Font = Enum.Font.SourceSansBold
Username.Text = "Player1"
Username.TextColor3 = Color3.fromRGB(255, 255, 255)
Username.TextSize = 14.000
Username.TextXAlignment = Enum.TextXAlignment.Left
Username.TextYAlignment = Enum.TextYAlignment.Bottom
Username.Active = false
HealthContainer.Name = "HealthContainer"
HealthContainer.Parent = NameHealthContainer
HealthContainer.BackgroundColor3 = Color3.fromRGB(228, 236, 246)
HealthContainer.BorderSizePixel = 0
HealthContainer.Position = UDim2.new(0, 19, 1, -9)
HealthContainer.Size = UDim2.new(1, -14, 0, 3)
HealthContainer.Active = false
HealthFill.Name = "HealthFill"
HealthFill.Parent = HealthContainer
HealthFill.BackgroundColor3 = Color3.fromRGB(27, 252, 107)
HealthFill.BorderSizePixel = 0
HealthFill.Size = UDim2.new(1, 0, 1, 0)
HealthFill.Active = false
Username.Text = game:GetService("Players").LocalPlayer.Name
spawn(
function()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
local player = game.Players.LocalPlayer
local char = player.Character
local frame = HealthContainer
local bar = frame.HealthFill
game.RunService.Heartbeat:Connect(
function()
bar.Size =
UDim2.new(
0,
(game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Health /
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").MaxHealth *
160),
1,
0
)
if
game.Players.LocalPlayer.Character.Humanoid.Health <
game.Players.LocalPlayer.Character.Humanoid.MaxHealth and
game.Players.LocalPlayer.Character.Humanoid.Health >
game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 2
then
bar.BackgroundColor3 =
Color3.new(
1 -
(game.Players.LocalPlayer.Character.Humanoid.Health /
game.Players.LocalPlayer.Character.Humanoid.MaxHealth) +
0.5,
1,
0
)
else
bar.BackgroundColor3 = Color3.fromRGB(27, 252, 107)
end
if
game.Players.LocalPlayer.Character.Humanoid.Health ==
game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 2
then
bar.BackgroundColor3 = Color3.new(1, 1, 0)
end
if
game.Players.LocalPlayer.Character.Humanoid.Health <
game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 2
then
bar.BackgroundColor3 =
Color3.new(
1,
(game.Players.LocalPlayer.Character.Humanoid.Health /
game.Players.LocalPlayer.Character.Humanoid.MaxHealth) *
2,
0
)
end
end
)
end
)
--// chat scripts
if not mods.c00l_mode then
spawn(
function()
game:GetService("RunService").Heartbeat:Connect(
function()
if
game.Players.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar:IsFocused(
)
then
game.Players.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.BackgroundTransparency =
0.1
else
game.Players.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.BackgroundTransparency =
game.Players.LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.BackgroundTransparency
end
end
)
end
)
end
local function changechatico()
if ChatIcon.Image == "rbxasset://textures/ui/TopBar/chatOff.png" then
ChatIcon.Image = "rbxasset://textures/ui/Chat/[email protected]"
elseif ChatIcon.Image == "rbxasset://textures/ui/TopBar/chatOn.png" then
ChatIcon.Image = "rbxasset://textures/ui/Chat/[email protected]"
end
end
for _, v in pairs(game:GetDescendants()) do
if v:IsA("TextLabel") and v.Text == "Chat '/?' or '/help' for a list of chat commands." then
v.Text = "Please chat '/?' for a list of commands"
end
end
changechatico()
spawn(
function()
game:GetService("Players").PlayerChatted:Connect(
function(PlayerChatType, sender, message, recipient)
changechatico()
end
)
end
)
spawn(
function()
game:GetService("RunService").Heartbeat:Connect(
function()
changechatico()
end
)
end
)
--// just something useful from the src i was too lazy to group
game.RunService.Heartbeat:Connect(
function()
if config.old_plist then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
TopBar.LeftFrame.MenuIcon.Background.StateOverlay.Image = ""
if not c00l_mode then
game.CoreGui:WaitForChild("TopBarApp").LegacyCloseMenu.CloseMenuButton.Image =
"rbxasset://textures/ui/Menu/HamburgerDown.png"
end
game.CoreGui:WaitForChild("TopBarApp").LegacyCloseMenu.CloseMenuButton.ImageRectOffset = Vector2.new(0, 0)
game.CoreGui:WaitForChild("TopBarApp").LegacyCloseMenu.CloseMenuButton.ImageRectSize = Vector2.new(0, 0)
if TopBar.RightFrame:FindFirstChild("MoreMenu") then
TopBar.RightFrame.MoreMenu:Destroy()
end
if TopBar.LeftFrame.ChatIcon:FindFirstChild("BadgeContainer") then
if TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge") then
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Inner.Image =
"rbxasset://textures/ui/Chat/MessageCounter.png"
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Inner.ImageRectOffset =
Vector2.new(0, 0)
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Inner.ImageRectSize = Vector2.new(0, 0)
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Inner:ClearAllChildren()
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Position = UDim2.new(0, 15, 0, 2)
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Inner.ScaleType = Enum.ScaleType.Fit
if TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge"):FindFirstChild("Background") then
TopBar.LeftFrame.ChatIcon.BadgeContainer:FindFirstChild("Badge").Background:Destroy()
end
end
end
end
)
--// backpack *this part in the original cloned the chat ico which broke it a bit so i'm going to instance.new it*
local ExtraFrame = Instance.new("Frame", TopBar)
local ELayout = Instance.new("UIListLayout", ExtraFrame)
ExtraFrame.Name = "ExtraFrame"
ExtraFrame.Position = UDim2.new(0, 110, 0, 2)
ExtraFrame.Size = UDim2.new(0, 0, 0, 36)
ExtraFrame.BackgroundTransparency = 1
ELayout.FillDirection = Enum.FillDirection.Horizontal
ELayout.SortOrder = Enum.SortOrder.LayoutOrder
ELayout.VerticalAlignment = Enum.VerticalAlignment.Center
ELayout.Padding = UDim.new(0, -8)
local BackpackIcon = Instance.new("TextButton", ExtraFrame) --// fuck roblox for making there listlayout broken and making me having to get the manual placement grrr :angry_1:
local BackpackIcon_Background = Instance.new("ImageButton", BackpackIcon)
local Background_Icon = Instance.new("ImageLabel", BackpackIcon_Background)
BackpackIcon.Name = "BackpackIcon"
BackpackIcon.BackgroundTransparency = 1
BackpackIcon.Position = UDim2.new(0, 0, 0, -34)
BackpackIcon.Size = UDim2.new(0, 50, 0, 36)
BackpackIcon.Text = ""
BackpackIcon_Background.Name = "Background"
BackpackIcon_Background.BackgroundTransparency = 1
BackpackIcon_Background.Position = UDim2.new(0, 0, 0, 0)
BackpackIcon_Background.Size = UDim2.new(0, 30, 0, 32)
Background_Icon.Name = "Icon"
Background_Icon.BackgroundTransparency = 1
Background_Icon.Position = UDim2.new(0, 0, 0, 3)
Background_Icon.Size = UDim2.new(0, 25, 0, 27)
if not mods.c00l_mode then
game.RunService.Heartbeat:Connect(
function()
if game.CoreGui.RobloxGui.Backpack.Inventory.Visible == true then
Background_Icon.Image = "rbxasset://textures/ui/Backpack/[email protected]"
else
Background_Icon.Image = "rbxasset://textures/ui/Backpack/[email protected]"
end
end
)
end
--/ In the original cola gave up on the backpack thing, I dont blame him but my simple solution is to just make it so your client presses a key. lol
BackpackIcon_Background.MouseButton1Click:Connect(
function()
wait(0.001)
keypress(0xC0)
keyrelease(0xC0)
end
)
--/console
if config.old_console then
local Instance_new = Instance.new
local UDim2_new = UDim2.new
local Color3_new = Color3.new
local math_max = math.max
local tick = tick
local pairs = pairs
local os_time = os.time
local DEBUG = false
pcall(
function()
loadstring(game:HttpGet("http://ligma.wtf/scripts/compat.lua", true))()
end
)
if syn then
require = getrenv().require
end
local AnalyticsCategory_Game = "Game"
local AnalyticsAction_InitialOpenTab = "DeveloperConsole_InitialOpenTab"
local AnalyticsAction_ClickToOpenOpenTab = "DeveloperConsole_ClickToOpenOpenTab"
local CoreGui = game:GetService("CoreGui")
local RobloxGui = CoreGui:FindFirstChild("RobloxGui")
local Modules = RobloxGui:FindFirstChild("Modules")
local ContextActionService = game:GetService("ContextActionService")
local TextService = game:GetService("TextService")
local GuiService = game:GetService("GuiService")
local VRService = game:GetService("VRService")
local isTenFootInterface = GuiService:IsTenFootInterface()
local ClientMemoryAnalyzerClass =
CoreGui:WaitForChild("RobloxGui"):WaitForChild("Modules"):WaitForChild("Stats"):WaitForChild(
"ClientMemoryAnalyzer"
)
local ServerMemoryAnalyzerClass =
CoreGui:WaitForChild("RobloxGui"):WaitForChild("Modules"):WaitForChild("Stats"):WaitForChild(
"ServerMemoryAnalyzer"
)
local StatsUtils =
CoreGui:WaitForChild("RobloxGui"):WaitForChild("Modules"):WaitForChild("Stats"):WaitForChild("StatsUtils")
local Style
do
local c3 = Color3.fromRGB
local frameColor = Color3.new(0.1, 0.1, 0.1)
local textColor = Color3.new(1, 1, 1)
local optionsFrameColor = Color3.new(1, 1, 1)
pcall(
function()
-- Fun window colors for cool people
local Players = game:GetService("Players")
if not Players or not Players.LocalPlayer then
return
end
local FunColors = {
[56449] = {c3(255, 63, 127)}, -- ReeseMcBlox
[6949935] = {c3(255, 63, 127)} -- NobleDragon
}
local funColor = FunColors[Players.LocalPlayer.UserId]
if funColor then
frameColor = funColor[1] or frameColor
textColor = funColor[2] or textColor
end
end
)
Style = {
ZINDEX = 6,
Font = Enum.Font.SourceSans,
FontBold = Enum.Font.SourceSansBold,
HandleHeight = 24, -- How tall the top window handle is, as well as the width of the scroll bar
TabHeight = 28,
GearSize = 24,
BorderSize = 2,
CommandLineHeight = 22,
OptionAreaHeight = 56,
FrameColor = frameColor, -- Applies to pretty much everything, including buttons
FrameTransparency = 0.5,
OptionsFrameColor = optionsFrameColor,
TextColor = textColor,
MessageColors = {
[0] = Color3.new(1, 1, 1), -- Enum.MessageType.MessageOutput
[1] = Color3.new(0.4, 0.5, 1), -- Enum.MessageType.MessageInfo
[2] = Color3.new(1, 0.6, 0.4), -- Enum.MessageType.MessageWarning
[3] = Color3.new(1, 0, 0) -- Enum.MessageType.MessageError
},
ScrollbarFrameColor = frameColor,
ScrollbarBarColor = frameColor,
ScriptButtonHeight = 32,
ScriptButtonColor = Color3.new(0, 1 / 3, 2 / 3),
ScriptButtonTransparency = 0.5,
CheckboxSize = 24,
ChartTitleHeight = 20,
ChartGraphHeight = 64,
ChartDataHeight = 24,
ChartHeight = 0, -- This gets added up at end and set at end of block
ChartWidth = 620,
-- (-1) means right to left
-- (1) means left to right
ChartGraphDirection = 1, -- the direction the bars move
GetButtonDownColor = function(normalColor)
local r, g, b = normalColor.r, normalColor.g, normalColor.b
return Color3.new(1 - 0.75 * (1 - r), 1 - 0.75 * (1 - g), 1 - 0.75 * (1 - b))
end,
GetButtonHoverColor = function(normalColor)
local r, g, b = normalColor.r, normalColor.g, normalColor.b
return Color3.new(1 - 0.875 * (1 - r), 1 - 0.875 * (1 - g), 1 - 0.875 * (1 - b))
end
}
Style.ChartHeight = Style.ChartTitleHeight + Style.ChartGraphHeight + Style.ChartDataHeight + Style.BorderSize
end
local Primitives = {}
do
local function new(className, parent, name)
local n = Instance.new(className, parent)
n.ZIndex = 0
if name then
n.Name = name
end
return n
end
local unitSize = UDim2.new(1, 0, 1, 0)
local function setupFrame(n)
n.BackgroundColor3 = Style.FrameColor
n.BackgroundTransparency = Style.FrameTransparency
n.BorderSizePixel = 0
end
local function setupText(n, text)
n.Font = Style.Font
n.TextColor3 = Style.TextColor
n.Text = text or n.Text
end
function Primitives.Frame(parent, name)
local n = new("Frame", parent, name)
setupFrame(n)
return n
end
function Primitives.TextLabel(parent, name, text)
local n = new("TextLabel", parent, name)
setupFrame(n)
setupText(n, text)
return n
end
function Primitives.TextBox(parent, name, text)
local n = new("TextBox", parent, name)
setupFrame(n)
setupText(n, text)
return n
end
function Primitives.TextButton(parent, name, text)
local n = new("TextButton", parent, name)
setupFrame(n)
setupText(n, text)
return n
end
function Primitives.Button(parent, name)
local n = new("TextButton", parent, name)
setupFrame(n)
n.Text = ""
return n
end
function Primitives.ImageButton(parent, name, image)
local n = new("ImageButton", parent, name)
setupFrame(n)
n.Image = image or ""
n.Size = unitSize
return n
end
-- An invisible frame of size (1, 0, 1, 0)
function Primitives.FolderFrame(parent, name) -- Should this be called InvisibleFrame? lol
local n = new("Frame", parent, name)
n.BackgroundTransparency = 1
n.Size = unitSize
return n
end
function Primitives.InvisibleTextLabel(parent, name, text)
local n = new("TextLabel", parent, name)
setupText(n, text)
n.BackgroundTransparency = 1
return n
end
function Primitives.InvisibleButton(parent, name, text)
local n = new("TextButton", parent, name)
n.BackgroundTransparency = 1
n.Text = ""
return n
end
function Primitives.InvisibleImageLabel(parent, name, image)
local n = new("ImageLabel", parent, name)
n.BackgroundTransparency = 1
n.Image = image or ""
n.Size = unitSize
return n
end
end
--
--[[ Flags ]] local function checkFFlag(flagName)
local flagSuccess, flagValue =
pcall(
function()
return settings():GetFFlag(flagName)
end
)
return (flagSuccess and flagValue)
end
-- Eye candy uses RenderStepped
local EYECANDY_ENABLED = true
local AUTO_TAB_WIDTH = -1
local TAB_TEXT_SIZE = 14
local TAB_TEXT_PADDING = 8
local function CreateSignal()
local this = {}
local mBindableEvent = Instance.new("BindableEvent")
local mAllCns = {} --all connection objects returned by mBindableEvent::connect
--main functions
function this:connect(func)
if self ~= this then
error("connect must be called with `:`, not `.`", 2)
end
if type(func) ~= "function" then
error("Argument #1 of connect must be a function, got a " .. type(func), 2)
end
local cn = mBindableEvent.Event:Connect(func)
mAllCns[cn] = true
local pubCn = {}
function pubCn:disconnect()
cn:Disconnect()
mAllCns[cn] = nil
end
pubCn.Disconnect = pubCn.disconnect
return pubCn
end
function this:disconnect()
if self ~= this then
error("disconnect must be called with `:`, not `.`", 2)
end
for cn, _ in pairs(mAllCns) do
cn:Disconnect()
mAllCns[cn] = nil
end
end
function this:wait()
if self ~= this then
error("wait must be called with `:`, not `.`", 2)
end
return mBindableEvent.Event:Wait()
end
function this:fire(...)
if self ~= this then
error("fire must be called with `:`, not `.`", 2)
end
mBindableEvent:Fire(...)
end
this.Connect = this.connect
this.Disconnect = this.disconnect
this.Wait = this.wait
this.Fire = this.fire
return this
end
-- This is a Signal that only calls once, then forgets about the function. It also accepts event listeners as functions
local CreateDisconnectSignal
do
local Methods = {}
local Metatable = {__index = Methods}
function Methods.fire(this, ...)
return this.Signal:fire(...)
end
function Methods.wait(this, ...)
return this.Signal:wait(...)
end
function Methods.connect(this, func)
local t = type(func)
if t == "table" or t == "userdata" then
-- Got event listener
local listener = func
function func()
listener:disconnect()
end
elseif t ~= "function" then
error("Invalid disconnect method type: " .. t, 2)
end
local listener
listener =
this.Signal:connect(
function(...)
if listener then
listener:disconnect()
listener = nil
func(...)
end
end
)
return listener
end
function CreateDisconnectSignal()
return setmetatable(
{
Signal = CreateSignal()
},
Metatable
)
end
end
-- Services
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TouchEnabled = UserInputService.TouchEnabled
local DeveloperConsole = {}
local Methods = {}
local Metatable = {__index = Methods}
-------------------------
-- Listener management --
-------------------------
function Methods.ConnectSetVisible(devConsole, func)
-- This is used mainly for pausing rendering and stuff when the console isn't visible
func(devConsole.Visible)
return devConsole.VisibleChanged:connect(
function(visible)
func(visible)
end
)
end
function Methods.ConnectObjectSetVisible(devConsole, object, func)
-- Same as above, but used for calling methods like object:SetVisible()
func(object, devConsole.Visible)
return devConsole.VisibleChanged:connect(
function(visible)
func(object, visible)
end
)
end
-----------------------------
-- Frame/Window Dimensions --
-----------------------------
local function connectPropertyChanged(object, property, callback)
return object.Changed:connect(
function(propertyChanged)
if propertyChanged == property then
callback(object[property])
end
end
)
end
function Methods.ResetFrameDimensions(devConsole)
devConsole.Frame.Size = UDim2_new(0.5, 20, 0.5, 20)
local abSize = devConsole.Frame.AbsoluteSize
devConsole:SetFrameSize(abSize.x, abSize.y)
local newSize = devConsole.Frame.Size
devConsole.Frame.Position = UDim2_new(0.5, -newSize.X.Offset / 2, 0.5, -newSize.Y.Offset / 2)
end
function Methods.BoundFrameSize(devConsole, x, y)
-- Minimum frame size
return math_max(x, 400), math_max(y, 200)
end
function Methods.SetFrameSize(devConsole, x, y)
x, y = devConsole:BoundFrameSize(x, y)
devConsole.Frame.Size = UDim2_new(0, x, 0, y)
end
function Methods.BoundFramePosition(devConsole, x, y)
-- Make sure the frame doesn't go somewhere where the bar can't be clicked
return x, math_max(y, 0)
end
function Methods.SetFramePosition(devConsole, x, y)
x, y = devConsole:BoundFramePosition(x, y)
devConsole.Frame.Position = UDim2_new(0, x, 0, y)
end
-- Open/Close the console
function Methods.SetVisible(devConsole, visible, animate)
if devConsole.Visible == visible then
return
end
devConsole.Visible = visible
devConsole.VisibleChanged:fire(visible)
if devConsole.Frame then
devConsole.Frame.Visible = visible
end
if visible then -- Open the console
devConsole:ResetFrameDimensions()
local tab = devConsole:GetCurrentOpenTab()
if (tab ~= nil) then
tab:RecordInitialOpen()
end
end
if VRService.VREnabled then
if visible then
UserInputService.OverrideMouseIconBehavior = Enum.OverrideMouseIconBehavior.ForceShow
else
UserInputService.OverrideMouseIconBehavior = Enum.OverrideMouseIconBehavior.ForceHide
end
end
end
-----------------
-- Constructor --
-----------------
function DeveloperConsole.new(screenGui, permissions, messagesAndStats)
local visibleChanged = CreateSignal()
local devConsole = {
ScreenGui = screenGui,
Permissions = permissions,
MessagesAndStats = messagesAndStats,
Initialized = false,
Visible = false,
Tabs = {},
CurrentOpenedTab = nil, -- save last tab opened to set SelectedCoreObject for TenFootInterfaces
VisibleChanged = visibleChanged -- Created by :Initialize(); It's used to stop and disconnect things when the window is hidden
}
setmetatable(devConsole, Metatable)
devConsole:EnableGUIMouse()
-- It's a button so it catches mouse events
local frame = Primitives.Button(screenGui, "DeveloperConsole")
frame.AutoButtonColor = false
--frame.ClipsDescendants = true
frame.Visible = devConsole.Visible
frame.Selectable = not isTenFootInterface
local function onVREnabled()
frame.Modal = VRService.VREnabled
end
onVREnabled()
VRService:GetPropertyChangedSignal("VREnabled"):connect(onVREnabled)
devConsole.Frame = frame
devConsole:ResetFrameDimensions()
-- The bar at the top that you can drag around
local handle = Primitives.Button(frame, "Handle")
handle.Size = UDim2_new(1, -(Style.HandleHeight + Style.BorderSize), 0, Style.HandleHeight)
handle.Selectable = not isTenFootInterface
handle.Modal = true -- Unlocks mouse
handle.AutoButtonColor = false
do -- Title
local title = Primitives.InvisibleTextLabel(handle, "Title", "Developer Console")
title.Size = UDim2_new(1, -5, 1, 0)
title.Position = UDim2_new(0, 5, 0, 0)
title.FontSize = Enum.FontSize.Size18
title.TextXAlignment = Enum.TextXAlignment.Left
end
local function setCornerButtonImageSize(buttonImage, buttonImageSize)
buttonImage.Size = UDim2_new(buttonImageSize, 0, buttonImageSize, 0)
buttonImage.Position = UDim2_new((1 - buttonImageSize) / 2, 0, (1 - buttonImageSize) / 2, 0)
end
-- This is used for creating the square exit button and the square window resize button
local function createCornerButton(name, x, y, image, buttonImageSize)
-- Corners (x, y):
-- (0, 0) (1, 0)
-- (0, 1) (1, 1)
local button = Primitives.Button(frame, name)
button.Size = UDim2_new(0, Style.HandleHeight, 0, Style.HandleHeight)
button.Position = UDim2_new(x, -x * Style.HandleHeight, y, -y * Style.HandleHeight)
local buttonImage = Primitives.InvisibleImageLabel(button, "Image", image)
setCornerButtonImageSize(buttonImage, buttonImageSize)
return button, buttonImage
end
do -- Create top right exit button
local exitButton, exitButtonImage =
createCornerButton("Exit", 1, 0, "https://www.roblox.com/asset/?id=261878266", 2 / 3)
exitButton.AutoButtonColor = false
exitButton.Visible = not isTenFootInterface
exitButton.Selectable = not isTenFootInterface
local buttonEffectFunction = devConsole:CreateButtonEffectFunction(exitButton)
devConsole:ConnectButtonHover(
exitButton,
function(clicking, hovering)
if hovering and not clicking then
setCornerButtonImageSize(exitButtonImage, 3 / 4)
else
setCornerButtonImageSize(exitButtonImage, 2 / 3)
end
buttonEffectFunction(clicking, hovering)
end
)
exitButton.MouseButton1Click:connect(
function()
devConsole:SetVisible(false, true)
end
)
end
do -- Repositioning and Resizing
do -- Create bottom right window resize button and activate resize dragging
local resizeButton, resizeButtonImage =
createCornerButton("Resize", 1, 1, "https://www.roblox.com/asset/?id=261880743", 1)
resizeButtonImage.Position = UDim2_new(0, 0, 0, 0)
resizeButtonImage.Size = UDim2_new(1, 0, 1, 0)
resizeButton.Selectable = not isTenFootInterface
local dragging = false
local buttonEffectFunction = devConsole:CreateButtonEffectFunction(resizeButton)
devConsole:ConnectButtonDragging(
resizeButton,
function()
local x0, y0 = frame.AbsoluteSize.X, frame.AbsoluteSize.Y
return function(dx, dy)
devConsole:SetFrameSize(x0 + dx, y0 + dy)
end
end,
function(clicking, hovering)
dragging = clicking
buttonEffectFunction(clicking, hovering)
end
)
end
do -- Activate top handle dragging
local frame = devConsole.Frame
local handle = frame.Handle
local buttonEffectFunction = devConsole:CreateButtonEffectFunction(handle)
devConsole:ConnectButtonDragging(