Repository navigation
Expand file tree
/
Copy pathSettings.lua
More file actions
2558 lines (2239 loc) · 89.7 KB
/
Copy pathSettings.lua
File metadata and controls
2558 lines (2239 loc) · 89.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
local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do
instance.ChildAdded:wait()
end
end
local function waitForProperty(instance, property)
while not instance[property] do
instance.Changed:wait()
end
end
--Include
local Create = assert(LoadLibrary("RbxUtility")).Create
-- A Few Script Globals
local gui
if script.Parent:FindFirstChild("ControlFrame") then
gui = script.Parent:FindFirstChild("ControlFrame")
else
gui = script.Parent
end
local helpButton = nil
local updateCameraDropDownSelection = nil
local updateVideoCaptureDropDownSelection = nil
local updateSmartCameraDropDownSelection = nil
local updateMovementDropDownSelection = nil
local syncVideoCaptureSetting = nil
local tweenTime = 0.2
local mouseLockLookScreenUrl = "http://www.roblox.com/asset?id=54071825"
local classicLookScreenUrl = "http://www.roblox.com/Asset?id=45915798"
local hasGraphicsSlider = true
local GraphicsQualityLevels = 10 -- how many levels we allow on graphics slider
local recordingVideo = false
local currentMenuSelection = nil
local lastMenuSelection = {}
local defaultPosition = UDim2.new(0,0,0,0)
local centerDialogs = {}
local mainShield = nil
local settingsChoices = {}
local testReport = false
local inStudioMode = UserSettings().GameSettings:InStudioMode()
-- REMOVE WHEN NOT TESTING
-- inStudioMode = false
local macClient = false
local success, isMac = pcall(function() return not game:GetService("GuiService").IsWindows end)
macClient = success and isMac
-- REMOVE WHEN NOT TESTING
--macClient = true
local customCameraDefaultType = "Default (Classic)"
local touchClient = false
pcall(function() touchClient = game:GetService("UserInputService").TouchEnabled end)
-- REMOVE WHEN NOT TESTING
-- touchClient = true
if touchClient then
hasGraphicsSlider = false
customCameraDefaultType = "Default (Follow)"
end
local newMovementScripts = false
local successFlagRead, luaFlagValue = pcall(function() return settings():GetFFlag("UseLuaCameraAndControl") end)
if successFlagRead and luaFlagValue == true then
newMovementScripts = true
end
local function Color3I(r,g,b)
return Color3.new(r/255,g/255,b/255)
end
local function robloxLock(instance)
instance.RobloxLocked = true
children = instance:GetChildren()
if children then
for i, child in ipairs(children) do
robloxLock(child)
end
end
end
function resumeGameFunction(shield)
shield.Settings:TweenPosition(UDim2.new(0.5, -262,-0.5, -200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
delay(tweenTime,function()
shield.Visible = false
for i = 1, #centerDialogs do
centerDialogs[i].Visible = false
game:GetService("GuiService"):RemoveCenterDialog(centerDialogs[i])
end
game:GetService("GuiService"):RemoveCenterDialog(shield)
settingsButton.Active = true
currentMenuSelection = nil
lastMenuSelection = {}
pcall(function() game:GetService("UserInputService").OverrideMouseIconEnabled = false end)
end)
end
function goToMenu(container,menuName, moveDirection,size,position)
if type(menuName) ~= "string" then return end
table.insert(lastMenuSelection,currentMenuSelection)
if menuName == "GameMainMenu" then
lastMenuSelection = {}
end
local containerChildren = container:GetChildren()
local selectedMenu = false
for i = 1, #containerChildren do
if containerChildren[i].Name == menuName then
containerChildren[i].Visible = true
currentMenuSelection = {container = container,name = menuName, direction = moveDirection, lastSize = size}
selectedMenu = true
if size and position then
containerChildren[i]:TweenSizeAndPosition(size,position,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
elseif size then
containerChildren[i]:TweenSizeAndPosition(size,UDim2.new(0.5,-size.X.Offset/2,0.5,-size.Y.Offset/2),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
else
containerChildren[i]:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
end
else
if moveDirection == "left" then
containerChildren[i]:TweenPosition(UDim2.new(-1,-525,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
elseif moveDirection == "right" then
containerChildren[i]:TweenPosition(UDim2.new(1,525,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
elseif moveDirection == "up" then
containerChildren[i]:TweenPosition(UDim2.new(0,0,-1,-400),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
elseif moveDirection == "down" then
containerChildren[i]:TweenPosition(UDim2.new(0,0,1,400),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
end
delay(tweenTime,function()
containerChildren[i].Visible = false
end)
end
end
end
function resetLocalCharacter()
local player = game:GetService("Players").LocalPlayer
if player then
if player.Character and player.Character:FindFirstChild("Humanoid") then
player.Character.Humanoid.Health = 0
end
end
end
local function createTextButton(text,style,fontSize,buttonSize,buttonPosition)
local newTextButton = Instance.new("TextButton")
newTextButton.Font = Enum.Font.SourceSansBold
newTextButton.FontSize = fontSize
newTextButton.Size = buttonSize
newTextButton.Position = buttonPosition
newTextButton.Style = style
newTextButton.TextColor3 = Color3.new(1,1,1)
newTextButton.Text = text
return newTextButton
end
local function CreateTextButtons(frame, buttons, yPos, ySize)
if #buttons < 1 then
error("Must have more than one button")
end
local buttonNum = 1
local buttonObjs = {}
local function toggleSelection(button)
for i, obj in ipairs(buttonObjs) do
if obj == button then
obj.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
else
obj.Style = Enum.ButtonStyle.RobloxRoundButton
end
end
end
for i, obj in ipairs(buttons) do
local button = Instance.new("TextButton")
button.Name = "Button" .. buttonNum
button.Font = Enum.Font.SourceSansBold
button.FontSize = Enum.FontSize.Size18
button.AutoButtonColor = true
button.Style = Enum.ButtonStyle.RobloxRoundButton
button.Text = obj.Text
button.TextColor3 = Color3.new(1,1,1)
button.MouseButton1Click:connect(function() toggleSelection(button) obj.Function() end)
button.Parent = frame
button.ZIndex = 8
buttonObjs[buttonNum] = button
buttonNum = buttonNum + 1
end
toggleSelection(buttonObjs[1])
local numButtons = buttonNum-1
if numButtons == 1 then
frame.Button1.Position = UDim2.new(0.35, 0, yPos.Scale, yPos.Offset)
frame.Button1.Size = UDim2.new(.4,0,ySize.Scale, ySize.Offset)
elseif numButtons == 2 then
frame.Button1.Position = UDim2.new(0.1, 0, yPos.Scale, yPos.Offset)
frame.Button1.Size = UDim2.new(.35,0, ySize.Scale, ySize.Offset)
frame.Button2.Position = UDim2.new(0.55, 0, yPos.Scale, yPos.Offset)
frame.Button2.Size = UDim2.new(.35,0, ySize.Scale, ySize.Offset)
elseif numButtons >= 3 then
local spacing = .1 / numButtons
local buttonSize = .9 / numButtons
buttonNum = 1
while buttonNum <= numButtons do
buttonObjs[buttonNum].Position = UDim2.new(spacing*buttonNum + (buttonNum-1) * buttonSize, 0, yPos.Scale, yPos.Offset)
buttonObjs[buttonNum].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset)
buttonNum = buttonNum + 1
end
end
end
function setRecordGui(recording, stopRecordButton, recordVideoButton)
if recording then
stopRecordButton.Visible = true
recordVideoButton.Text = "Stop Recording"
else
stopRecordButton.Visible = false
recordVideoButton.Text = "Record Video"
end
end
function recordVideoClick(recordVideoButton, stopRecordButton)
recordingVideo = not recordingVideo
setRecordGui(recordingVideo, stopRecordButton, recordVideoButton)
end
local currentlyToggling = false;
local DevConsoleToggle = nil;
delay(0, function()
DevConsoleToggle = gui:WaitForChild("ToggleDevConsole")
end)
function toggleDeveloperConsole()
if not DevConsoleToggle then
return
end
DevConsoleToggle:Invoke()
end
function backToGame(buttonClicked, shield, settingsButton)
buttonClicked.Parent.Parent.Parent.Parent.Visible = false
shield.Visible = false
for i = 1, #centerDialogs do
game:GetService("GuiService"):RemoveCenterDialog(centerDialogs[i])
centerDialogs[i].Visible = false
end
centerDialogs = {}
game:GetService("GuiService"):RemoveCenterDialog(shield)
settingsButton.Active = true
end
function setDisabledState(guiObject)
if not guiObject then return end
if guiObject:IsA("TextLabel") then
guiObject.TextTransparency = 0.9
elseif guiObject:IsA("TextButton") then
guiObject.TextTransparency = 0.9
guiObject.Active = false
else
if guiObject["ClassName"] then
print("setDisabledState() got object of unsupported type. object type is ",guiObject.ClassName)
end
end
end
local function createHelpDialog(baseZIndex)
if helpButton == nil then
if gui:FindFirstChild("TopLeftControl") and gui.TopLeftControl:FindFirstChild("Help") then
helpButton = gui.TopLeftControl.Help
elseif gui:FindFirstChild("BottomRightControl") and gui.BottomRightControl:FindFirstChild("Help") then
helpButton = gui.BottomRightControl.Help
end
end
local shield = Instance.new("Frame")
shield.Name = "HelpDialogShield"
shield.Active = true
shield.Visible = false
shield.Size = UDim2.new(1,0,1,0)
shield.BackgroundColor3 = Color3I(51,51,51)
shield.BorderColor3 = Color3I(27,42,53)
shield.BackgroundTransparency = 0.4
shield.ZIndex = baseZIndex + 2
local helpDialog = Instance.new("Frame")
helpDialog.Name = "HelpDialog"
helpDialog.Style = Enum.FrameStyle.DropShadow
helpDialog.Position = UDim2.new(.2, 0, .2, 0)
helpDialog.Size = UDim2.new(0.6, 0, 0.6, 0)
helpDialog.Active = true
helpDialog.Parent = shield
helpDialog.ZIndex = baseZIndex + 2
local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "Title"
titleLabel.Text = "Keyboard & Mouse Controls"
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.FontSize = Enum.FontSize.Size36
titleLabel.Position = UDim2.new(0, 0, 0.025, 0)
titleLabel.Size = UDim2.new(1, 0, 0, 40)
titleLabel.TextColor3 = Color3.new(1,1,1)
titleLabel.BackgroundTransparency = 1
titleLabel.Parent = helpDialog
titleLabel.ZIndex = baseZIndex + 2
local buttonRow = Instance.new("Frame")
buttonRow.Name = "Buttons"
buttonRow.Position = UDim2.new(0.1, 0, .07, 40)
buttonRow.Size = UDim2.new(0.8, 0, 0, 45)
buttonRow.BackgroundTransparency = 1
buttonRow.Parent = helpDialog
buttonRow.ZIndex = baseZIndex + 2
local imageFrame = Instance.new("Frame")
imageFrame.Name = "ImageFrame"
imageFrame.Position = UDim2.new(0.05, 0, 0.075, 80)
imageFrame.Size = UDim2.new(0.9, 0, .9, -120)
imageFrame.BackgroundTransparency = 1
imageFrame.Parent = helpDialog
imageFrame.ZIndex = baseZIndex + 2
local layoutFrame = Instance.new("Frame")
layoutFrame.Name = "LayoutFrame"
layoutFrame.Position = UDim2.new(0.5, 0, 0, 0)
layoutFrame.Size = UDim2.new(1.5, 0, 1, 0)
layoutFrame.BackgroundTransparency = 1
layoutFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY
layoutFrame.Parent = imageFrame
layoutFrame.ZIndex = baseZIndex + 2
local image = Instance.new("ImageLabel")
image.Name = "Image"
if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then
image.Image = mouseLockLookScreenUrl
else
image.Image = classicLookScreenUrl
end
image.Position = UDim2.new(-0.5, 0, 0, 0)
image.Size = UDim2.new(1, 0, 1, 0)
image.BackgroundTransparency = 1
image.Parent = layoutFrame
image.ZIndex = baseZIndex + 2
local buttons = {}
buttons[1] = {}
buttons[1].Text = "Look"
buttons[1].Function = function()
if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then
image.Image = mouseLockLookScreenUrl
else
image.Image = classicLookScreenUrl
end
end
buttons[2] = {}
buttons[2].Text = "Move"
buttons[2].Function = function()
image.Image = "http://www.roblox.com/Asset?id=45915811"
end
buttons[3] = {}
buttons[3].Text = "Gear"
buttons[3].Function = function()
image.Image = "http://www.roblox.com/Asset?id=45917596"
end
buttons[4] = {}
buttons[4].Text = "Zoom"
buttons[4].Function = function()
image.Image = "http://www.roblox.com/Asset?id=45915825"
end
CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1,0))
local devConsoleButton = Create'TextButton'{
Name = "DeveloperConsoleButton";
Text = "Log";
Size = UDim2.new(0,60,0,30);
Style = Enum.ButtonStyle.RobloxRoundButton;
Position = UDim2.new(1,-65,1,-35);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size18;
TextColor3 = Color3.new(1,1,1);
ZIndex = baseZIndex + 4;
BackgroundTransparency = 1;
Parent = helpDialog;
}
Create'TextLabel'{
Name = "DeveloperConsoleButton";
Text = "F9";
Size = UDim2.new(0,14,0,14);
Position = UDim2.new(1,-6,0, -2);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size12;
TextColor3 = Color3.new(0,1,0);
ZIndex = baseZIndex + 4;
BackgroundTransparency = 1;
Parent = devConsoleButton;
}
waitForProperty(game:GetService("Players"), "LocalPlayer")
game:GetService("Players").LocalPlayer:GetMouse().KeyDown:connect(function(key)
if string.byte(key) == 34 then --F9
toggleDeveloperConsole()
end
end)
devConsoleButton.MouseButton1Click:connect(function()
toggleDeveloperConsole()
shield.Visible = false
game:GetService("GuiService"):RemoveCenterDialog(shield)
end)
-- set up listeners for type of mouse mode, but keep constructing gui at same time
delay(0, function()
waitForChild(gui,"UserSettingsShield")
waitForChild(gui.UserSettingsShield,"Settings")
waitForChild(gui.UserSettingsShield.Settings,"SettingsStyle")
waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameSettingsMenu")
waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu, "CameraField")
waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField, "DropDownMenuButton")
gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed:connect(function(prop)
if prop ~= "Text" then return end
if buttonRow.Button1.Style == Enum.ButtonStyle.RobloxRoundDefaultButton then -- only change if this is the currently selected panel
if gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text == "Classic" then
image.Image = classicLookScreenUrl
else
image.Image = mouseLockLookScreenUrl
end
end
end)
end)
local okBtn = Instance.new("TextButton")
okBtn.Name = "OkBtn"
okBtn.Text = "OK"
okBtn.Modal = true
okBtn.Size = UDim2.new(0.3, 0, 0, 45)
okBtn.Position = UDim2.new(0.35, 0, .975, -50)
okBtn.Font = Enum.Font.SourceSansBold
okBtn.FontSize = Enum.FontSize.Size18
okBtn.BackgroundTransparency = 1
okBtn.TextColor3 = Color3.new(1,1,1)
okBtn.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
okBtn.ZIndex = baseZIndex + 2
okBtn.MouseButton1Click:connect(
function()
shield.Visible = false
game:GetService("GuiService"):RemoveCenterDialog(shield)
end)
okBtn.Parent = helpDialog
robloxLock(shield)
return shield
end
local function createLeaveConfirmationMenu(baseZIndex,shield)
local frame = Instance.new("Frame")
frame.Name = "LeaveConfirmationMenu"
frame.BackgroundTransparency = 1
frame.Size = UDim2.new(1,0,1,0)
frame.Position = UDim2.new(0,0,2,400)
frame.ZIndex = baseZIndex + 4
local yesButton = createTextButton("Leave",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,313,0.8,0))
yesButton.Name = "YesButton"
yesButton.ZIndex = baseZIndex + 4
yesButton.Parent = frame
yesButton.Modal = true
yesButton:SetVerb("Exit")
local noButton = createTextButton("Stay",Enum.ButtonStyle.RobloxRoundDefaultButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,90,0.8,0))
noButton.Name = "NoButton"
noButton.Parent = frame
noButton.ZIndex = baseZIndex + 4
noButton.MouseButton1Click:connect(function()
goToMenu(shield.Settings.SettingsStyle,"GameMainMenu","down",UDim2.new(0,525,0,430))
shield.Settings:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
end)
local leaveText = Instance.new("TextLabel")
leaveText.Name = "LeaveText"
leaveText.Text = "Leave this game?"
leaveText.Size = UDim2.new(1,0,0.8,0)
leaveText.TextWrap = true
leaveText.TextColor3 = Color3.new(1,1,1)
leaveText.Font = Enum.Font.SourceSansBold
leaveText.FontSize = Enum.FontSize.Size36
leaveText.BackgroundTransparency = 1
leaveText.ZIndex = baseZIndex + 4
leaveText.Parent = frame
return frame
end
local function createResetConfirmationMenu(baseZIndex,shield)
local frame = Instance.new("Frame")
frame.Name = "ResetConfirmationMenu"
frame.BackgroundTransparency = 1
frame.Size = UDim2.new(1,0,1,0)
frame.Position = UDim2.new(0,0,2,400)
frame.ZIndex = baseZIndex + 4
local yesButton = createTextButton("Reset",Enum.ButtonStyle.RobloxRoundDefaultButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,313,0,280))
yesButton.Name = "YesButton"
yesButton.ZIndex = baseZIndex + 4
yesButton.Parent = frame
yesButton.Modal = true
yesButton.MouseButton1Click:connect(function()
resumeGameFunction(shield)
resetLocalCharacter()
end)
local noButton = createTextButton("Cancel",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,90,0,280))
noButton.Name = "NoButton"
noButton.Parent = frame
noButton.ZIndex = baseZIndex + 4
noButton.MouseButton1Click:connect(function()
goToMenu(shield.Settings.SettingsStyle,"GameMainMenu","down",UDim2.new(0,525,0,430))
shield.Settings:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true)
end)
local resetCharacterText = Instance.new("TextLabel")
resetCharacterText.Name = "ResetCharacterText"
resetCharacterText.Text = "Are you sure you want to reset your character?"
resetCharacterText.Size = UDim2.new(1,0,0.8,0)
resetCharacterText.TextWrap = true
resetCharacterText.TextColor3 = Color3.new(1,1,1)
resetCharacterText.Font = Enum.Font.SourceSansBold
resetCharacterText.FontSize = Enum.FontSize.Size36
resetCharacterText.BackgroundTransparency = 1
resetCharacterText.ZIndex = baseZIndex + 4
resetCharacterText.Parent = frame
local fineResetCharacterText = resetCharacterText:Clone()
fineResetCharacterText.Name = "FineResetCharacterText"
fineResetCharacterText.Text = "You will be put back on a spawn point"
fineResetCharacterText.Size = UDim2.new(0,303,0,18)
fineResetCharacterText.Position = UDim2.new(0, 109, 0, 215)
fineResetCharacterText.FontSize = Enum.FontSize.Size18
fineResetCharacterText.Parent = frame
return frame
end
local function createGameMainMenu(baseZIndex, shield)
local buttonTop = 54
local gameMainMenuFrame = Instance.new("Frame")
gameMainMenuFrame.Name = "GameMainMenu"
gameMainMenuFrame.BackgroundTransparency = 1
gameMainMenuFrame.Size = UDim2.new(1,0,1,0)
gameMainMenuFrame.ZIndex = baseZIndex + 4
gameMainMenuFrame.Parent = settingsFrame
-- GameMainMenu Children
-- RESUME GAME
local resumeGameButton = createTextButton("Resume Game",Enum.ButtonStyle.RobloxRoundDefaultButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0.5,-170,0,buttonTop))
resumeGameButton.Name = "resumeGameButton"
resumeGameButton.ZIndex = baseZIndex + 4
resumeGameButton.Parent = gameMainMenuFrame
resumeGameButton.Modal = true
resumeGameButton.MouseButton1Click:connect(function() resumeGameFunction(shield) end)
buttonTop = buttonTop + 51
-- RESET CHARACTER
local resetButton = createTextButton("Reset Character",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0.5,-170,0,buttonTop))
resetButton.Name = "ResetButton"
resetButton.ZIndex = baseZIndex + 4
resetButton.Parent = gameMainMenuFrame
buttonTop = buttonTop + 51
-- GAME SETTINGS
local gameSettingsButton = createTextButton("Game Settings",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0.5,-170,0,buttonTop))
gameSettingsButton.Name = "SettingsButton"
gameSettingsButton.ZIndex = baseZIndex + 4
gameSettingsButton.Parent = gameMainMenuFrame
buttonTop = buttonTop + 51
-- HELP BUTTON
local robloxHelpButton = createTextButton("Help",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size18,UDim2.new(0,164,0,50),UDim2.new(0,92,0,buttonTop))
robloxHelpButton.Name = "HelpButton"
robloxHelpButton.ZIndex = baseZIndex + 4
robloxHelpButton.Parent = gameMainMenuFrame
robloxHelpButton.Visible = not touchClient
if macClient or touchClient then
robloxHelpButton.Size = UDim2.new(0,340,0,50)
robloxHelpButton.FontSize = Enum.FontSize.Size24
end
helpButton = robloxHelpButton
local helpDialog = createHelpDialog(baseZIndex)
helpDialog.Parent = gui
helpButton.MouseButton1Click:connect(
function()
table.insert(centerDialogs,helpDialog)
game:GetService("GuiService"):AddCenterDialog(helpDialog, Enum.CenterDialogType.ModalDialog,
--ShowFunction
function()
helpDialog.Visible = true
mainShield.Visible = false
end,
--HideFunction
function()
helpDialog.Visible = false
end)
end)
helpButton.Active = true
-- SCREEN SHOT
local screenshotButton = createTextButton("Screenshot",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2.new(0,264,0,buttonTop))
screenshotButton.Name = "ScreenshotButton"
screenshotButton.ZIndex = baseZIndex + 4
screenshotButton.Parent = gameMainMenuFrame
screenshotButton.Visible = not macClient and not touchClient
screenshotButton:SetVerb("Screenshot")
if not touchClient then
buttonTop = buttonTop + 51
end
-- REPORT ABUSE
local reportAbuseButton = createTextButton("Report Abuse",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size18,UDim2.new(0,164,0,50),UDim2.new(0,92,0,buttonTop))
reportAbuseButton.Name = "ReportAbuseButton"
reportAbuseButton.ZIndex = baseZIndex + 4
reportAbuseButton.Parent = gameMainMenuFrame
if macClient or touchClient then
reportAbuseButton.Size = UDim2.new(0,340,0,50)
reportAbuseButton.FontSize = Enum.FontSize.Size24
end
-- RECORD VIDEO
local recordVideoButton = createTextButton("Record Video",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2.new(0,264,0,buttonTop))
recordVideoButton.Name = "RecordVideoButton"
recordVideoButton.ZIndex = baseZIndex + 4
recordVideoButton.Parent = gameMainMenuFrame
recordVideoButton.Visible = not macClient and not touchClient
recordVideoButton:SetVerb("RecordToggle")
local stopRecordButton = Instance.new("ImageButton")
stopRecordButton.Name = "StopRecordButton"
stopRecordButton.BackgroundTransparency = 1
stopRecordButton.Image = "rbxasset://textures/ui/RecordStop.png"
stopRecordButton.Size = UDim2.new(0,59,0,27)
stopRecordButton:SetVerb("RecordToggle")
stopRecordButton.MouseButton1Click:connect(function() recordVideoClick(recordVideoButton, stopRecordButton) end)
stopRecordButton.Visible = false
stopRecordButton.Parent = gui
buttonTop = buttonTop + 51
-- LEAVE GAME
local leaveGameButton = createTextButton("Leave Game",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0.5,-170,0,buttonTop))
leaveGameButton.Name = "LeaveGameButton"
leaveGameButton.ZIndex = baseZIndex + 4
leaveGameButton.Parent = gameMainMenuFrame
return gameMainMenuFrame
end
local function createGameSettingsMenu(baseZIndex, shield)
local gameSettingsMenuFrame = Instance.new("Frame")
gameSettingsMenuFrame.Name = "GameSettingsMenu"
gameSettingsMenuFrame.BackgroundTransparency = 1
gameSettingsMenuFrame.Size = UDim2.new(1,0,1,0)
gameSettingsMenuFrame.ZIndex = baseZIndex + 4
local itemTop = 0
if game:GetService("GuiService"):GetScreenResolution().y <= 500 then
itemTop = 50
end
----------------------------------------------------------------------------------------------------
-- C A M E R A C O N T R O L S
----------------------------------------------------------------------------------------------------
if not touchClient then
local cameraLabel = Instance.new("TextLabel")
cameraLabel.Name = "CameraLabel"
if (newMovementScripts) then
cameraLabel.Text = "Enable Mouse Lock Switch"
else
cameraLabel.Text = "Character & Camera Controls"
end
cameraLabel.Font = Enum.Font.SourceSansBold
cameraLabel.FontSize = Enum.FontSize.Size18
cameraLabel.Position = UDim2.new(0,31,0,itemTop + 6)
cameraLabel.Size = UDim2.new(0,224,0,18)
cameraLabel.TextColor3 = Color3I(255,255,255)
cameraLabel.TextXAlignment = Enum.TextXAlignment.Left
cameraLabel.BackgroundTransparency = 1
cameraLabel.ZIndex = baseZIndex + 4
cameraLabel.Parent = gameSettingsMenuFrame
if (newMovementScripts) then
local mouseLockDisabled = Instance.new("TextLabel")
mouseLockDisabled.Name = "mouseLockDisabled"
mouseLockDisabled.Text = "Set by Game"
mouseLockDisabled.Font = Enum.Font.SourceSansBold
mouseLockDisabled.FontSize = Enum.FontSize.Size18
mouseLockDisabled.Position = UDim2.new(0,275,0,itemTop + 6)
mouseLockDisabled.Size = UDim2.new(0,200,0,18)
mouseLockDisabled.TextColor3 = Color3I(180,180,180)
mouseLockDisabled.TextXAlignment = Enum.TextXAlignment.Left
mouseLockDisabled.BackgroundTransparency = 1
mouseLockDisabled.ZIndex = baseZIndex + 4
mouseLockDisabled.Parent = gameSettingsMenuFrame
settingsChoices["MouseLockDisabled"] = mouseLockDisabled
end
local mouseLockLabel = game:GetService("CoreGui").RobloxGui:FindFirstChild("MouseLockLabel",true)
if (newMovementScripts) then
local mouseLockCheckbox = createTextButton("",Enum.ButtonStyle.RobloxRoundButton,Enum.FontSize.Size18,UDim2.new(0,32,0,32),UDim2.new(0, 270, 0, itemTop- 4))
mouseLockCheckbox.Name = "mouseLockCheckbox"
mouseLockCheckbox.ZIndex = baseZIndex + 4
mouseLockCheckbox.Parent = gameSettingsMenuFrame
if UserSettings().GameSettings.ControlMode.Name == "MouseLockSwitch" then
mouseLockCheckbox.Text = "X"
end
mouseLockCheckbox.MouseButton1Click:connect(function()
if mouseLockCheckbox.Text == "" then
mouseLockCheckbox.Text = "X"
UserSettings().GameSettings.ControlMode = "MouseLockSwitch"
else
mouseLockCheckbox.Text = ""
UserSettings().GameSettings.ControlMode = "Classic"
end
pcall(function()
if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then
mouseLockLabel.Visible = true
elseif mouseLockLabel then
mouseLockLabel.Visible = false
end
end)
end)
settingsChoices["MouseLockEnabled"] = mouseLockCheckbox
else
local enumItems = Enum.ControlMode:GetEnumItems()
local enumNames = {}
local enumNameToItem = {}
for i,obj in ipairs(enumItems) do
enumNames[i] = obj.Name
enumNameToItem[obj.Name] = obj
end
local cameraDropDown
cameraDropDown, updateCameraDropDownSelection = RbxGui.CreateDropDownMenu(enumNames,
function(text)
UserSettings().GameSettings.ControlMode = enumNameToItem[text]
pcall(function()
if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then
mouseLockLabel.Visible = true
elseif mouseLockLabel then
mouseLockLabel.Visible = false
end
end)
end, false, true, baseZIndex + 1)
cameraDropDown.Name = "CameraField"
cameraDropDown.Position = UDim2.new(0, 270, 0, itemTop)
cameraDropDown.Size = UDim2.new(0,200,0,32)
cameraDropDown.Parent = gameSettingsMenuFrame
end
itemTop = itemTop + 35
end
----------------------------------------------------------------------------------------------------
-- C U S T O M C A M E R A C O N T R O L S
----------------------------------------------------------------------------------------------------
local smartCameraLabel = Instance.new("TextLabel")
smartCameraLabel.Name = "SmartCameraLabel"
smartCameraLabel.Text = "Camera Mode"
smartCameraLabel.Font = Enum.Font.SourceSansBold
smartCameraLabel.FontSize = Enum.FontSize.Size18
smartCameraLabel.Position = UDim2.new(0,31,0,itemTop + 6)
smartCameraLabel.Size = UDim2.new(0,224,0,18)
smartCameraLabel.TextColor3 = Color3I(255,255,255)
smartCameraLabel.TextXAlignment = Enum.TextXAlignment.Left
smartCameraLabel.BackgroundTransparency = 1
smartCameraLabel.ZIndex = baseZIndex + 4
smartCameraLabel.Parent = gameSettingsMenuFrame
if (newMovementScripts) then
local smartCameraDisabled = Instance.new("TextLabel")
smartCameraDisabled.Name = "smartCameraDisabled"
smartCameraDisabled.Text = "Set by Game"
smartCameraDisabled.Font = Enum.Font.SourceSansBold
smartCameraDisabled.FontSize = Enum.FontSize.Size18
smartCameraDisabled.Position = UDim2.new(0,275,0,itemTop + 6)
smartCameraDisabled.Size = UDim2.new(0,200,0,18)
smartCameraDisabled.TextColor3 = Color3I(180,180,180)
smartCameraDisabled.TextXAlignment = Enum.TextXAlignment.Left
smartCameraDisabled.BackgroundTransparency = 1
smartCameraDisabled.ZIndex = baseZIndex + 4
smartCameraDisabled.Parent = gameSettingsMenuFrame
settingsChoices["CameraModeDevChoice"] = smartCameraDisabled
end
local smartEnumItems = nil
if (not newMovementScripts) then
smartEnumItems = Enum.CustomCameraMode:GetEnumItems()
elseif (touchClient) then
smartEnumItems = Enum.TouchCameraMovementMode:GetEnumItems()
else
smartEnumItems = Enum.ComputerCameraMovementMode:GetEnumItems()
end
local smartEnumNames = {}
local smartEnumNameToItem = {}
for i,obj in pairs(smartEnumItems) do
local displayName = obj.Name
if (obj.Name == "Default") then
displayName = customCameraDefaultType
end
smartEnumNames[i] = displayName
smartEnumNameToItem[displayName] = obj.Value
end
local smartCameraDropDown
smartCameraDropDown, updateSmartCameraDropDownSelection = RbxGui.CreateDropDownMenu(smartEnumNames,
function(text)
if (not newMovementScripts) then
UserSettings().GameSettings.CameraMode = smartEnumNameToItem[text]
elseif (touchClient) then
UserSettings().GameSettings.TouchCameraMovementMode = smartEnumNameToItem[text]
else
UserSettings().GameSettings.ComputerCameraMovementMode = smartEnumNameToItem[text]
end
end, false, true, baseZIndex + 1)
smartCameraDropDown.Name = "SmartCameraField"
smartCameraDropDown.Position = UDim2.new(0, 270, 0, itemTop)
smartCameraDropDown.Size = UDim2.new(0,200,0,32)
smartCameraDropDown.Parent = gameSettingsMenuFrame
settingsChoices["CameraModeUserChoice"] = smartCameraDropDown
itemTop = itemTop + 35
----------------------------------------------------------------------------------------------------
-- T O U C H M O V E M E N T C O N T R O L S
----------------------------------------------------------------------------------------------------
if (touchClient or newMovementScripts) then
local movementModeLabel = Instance.new("TextLabel")
movementModeLabel.Name = "movementModeLabel"
movementModeLabel.Text = "Movement Mode"
movementModeLabel.Font = Enum.Font.SourceSansBold
movementModeLabel.FontSize = Enum.FontSize.Size18
movementModeLabel.Position = UDim2.new(0,31,0,itemTop + 6)
movementModeLabel.Size = UDim2.new(0,224,0,18)
movementModeLabel.TextColor3 = Color3I(255,255,255)
movementModeLabel.TextXAlignment = Enum.TextXAlignment.Left
movementModeLabel.BackgroundTransparency = 1
movementModeLabel.ZIndex = baseZIndex + 4
movementModeLabel.Parent = gameSettingsMenuFrame
if (newMovementScripts) then
local movementModeDisabled = Instance.new("TextLabel")
movementModeDisabled.Name = "movementModeDisabled"
movementModeDisabled.Text = "Set by Game"
movementModeDisabled.Font = Enum.Font.SourceSansBold
movementModeDisabled.FontSize = Enum.FontSize.Size18
movementModeDisabled.Position = UDim2.new(0,275,0,itemTop + 6)
movementModeDisabled.Size = UDim2.new(0,200,0,18)
movementModeDisabled.TextColor3 = Color3I(180,180,180)
movementModeDisabled.TextXAlignment = Enum.TextXAlignment.Left
movementModeDisabled.BackgroundTransparency = 1
movementModeDisabled.ZIndex = baseZIndex + 4
movementModeDisabled.Parent = gameSettingsMenuFrame
settingsChoices["MovementModeDevChoice"] = movementModeDisabled
end
local enumNames
local enumNameToItem
if (touchClient) then
local touchEnumItems = Enum.TouchMovementMode:GetEnumItems()
local touchEnumNames = {}
local touchEnumNameToItem = {}
for i,obj in ipairs(touchEnumItems) do
local displayName = obj.Name
if (obj.Name == "Default") then
displayName = "Default (Thumbstick)"
end
touchEnumNames[i] = displayName
touchEnumNameToItem[displayName] = obj
end
enumNames = touchEnumNames
enumNameToItem = touchEnumNameToItem
else
local computerEnumItems = Enum.ComputerMovementMode:GetEnumItems()
local computerEnumNames = {}
local computerEnumNameToItem = {}
for i,obj in ipairs(computerEnumItems) do
local displayName = obj.Name
if (obj.Name == "Default") then
displayName = "Default (Keyboard)"
end
computerEnumNames[i] = displayName
computerEnumNameToItem[displayName] = obj
end
enumNames = computerEnumNames
enumNameToItem = computerEnumNameToItem
end
local movementModeDropDown
movementModeDropDown, updateMovementDropDownSelection = RbxGui.CreateDropDownMenu(enumNames,
function(text)
if (touchClient) then
UserSettings().GameSettings.TouchMovementMode = enumNameToItem[text]
else
UserSettings().GameSettings.ComputerMovementMode = enumNameToItem[text]
end
end, false, true, baseZIndex + 1)
movementModeDropDown.Name = "movementModeField"
movementModeDropDown.Position = UDim2.new(0, 270, 0, itemTop)
movementModeDropDown.Size = UDim2.new(0,200,0,32)
movementModeDropDown.Parent = gameSettingsMenuFrame
settingsChoices["MovementModeUserChoice"] = movementModeDropDown
itemTop = itemTop + 35
end
----------------------------------------------------------------------------------------------------
-- V I D E O C A P T U R E S E T T I N G S
----------------------------------------------------------------------------------------------------
if not macClient and not touchClient then
local videoCaptureLabel = Instance.new("TextLabel")
videoCaptureLabel.Name = "VideoCaptureLabel"
videoCaptureLabel.Text = "After Capturing Video"
videoCaptureLabel.Font = Enum.Font.SourceSansBold
videoCaptureLabel.FontSize = Enum.FontSize.Size18
videoCaptureLabel.Position = UDim2.new(0,32,0,itemTop + 6)
videoCaptureLabel.Size = UDim2.new(0,164,0,18)
videoCaptureLabel.BackgroundTransparency = 1
videoCaptureLabel.TextColor3 = Color3I(255,255,255)
videoCaptureLabel.TextXAlignment = Enum.TextXAlignment.Left
videoCaptureLabel.ZIndex = baseZIndex + 4
videoCaptureLabel.Parent = gameSettingsMenuFrame
local videoNames = {}
local videoNameToItem = {}
videoNames[1] = "Just Save to Disk"
videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"]
videoNames[2] = "Upload to YouTube"
videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"]
local videoCaptureDropDown = nil
videoCaptureDropDown, updateVideoCaptureDropDownSelection = RbxGui.CreateDropDownMenu(videoNames,
function(text)
UserSettings().GameSettings.VideoUploadPromptBehavior = videoNameToItem[text]
end, false, true, baseZIndex + 1)
videoCaptureDropDown.Name = "VideoCaptureField"
videoCaptureDropDown.Position = UDim2.new(0, 270, 0, itemTop)
videoCaptureDropDown.Size = UDim2.new(0,200,0,32)
videoCaptureDropDown.Parent = gameSettingsMenuFrame
syncVideoCaptureSetting = function()
if UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Never"] then
updateVideoCaptureDropDownSelection(videoNames[1])
elseif UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Ask me first"] then
updateVideoCaptureDropDownSelection(videoNames[2])
else
UserSettings().GameSettings.VideoUploadPromptBehavior = Enum.UploadSetting["Ask me first"]
updateVideoCaptureDropDownSelection(videoNames[2])