forked from Epix-Incorporated/Adonis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserPanel.luau
More file actions
1842 lines (1680 loc) · 51.1 KB
/
UserPanel.luau
File metadata and controls
1842 lines (1680 loc) · 51.1 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 canEditTables = {
Admins = true;
HeadAdmins = true;
Moderators = true;
Banned = true;
Muted = true;
Blacklist = true;
Whitelist = true;
Permissions = true;
MusicList = false;
InsertList = false;
CapeList = false;
CustomRanks = false;
OnStartup = true;
OnJoin = true;
OnSpawn = true;
Allowed_API_Calls = false;
HideScript = false;
}
local function tabToString(tab)
if type(tab) == "table" then
local str = table.create(#tab)
for i, v in tab do
table.insert(str, `{i}: {v}`)
end
return table.concat(str, "; ")
else
return tostring(tab)
end
end
return function(data, env)
if env then
setfenv(1, env)
end
local client: table = env.client
local service: table = env.service
local gui = env.gui
local UI = client.UI
local Remote = client.Remote
local Variables = client.Variables
local Deps = client.Deps
local Functions = client.Functions;
local keyCodeToName = Functions.KeyCodeToName;
local gTable
local window = UI.Make("Window", {
Name = "UserPanel";
Title = Variables.NightlyMode and "Adonis Nightly" or "Adonis";
Icon = Variables.NightlyMode and "rbxassetid://6877822142" or "rbxassetid://7681261289"; --"rbxassetid://7681088830"; --"rbxassetid://7681233602"; --"rbxassetid://7681048299";
Size = {465, 325};
AllowMultiple = false;
OnClose = function()
Variables.WaitingForBind = false
end
})
local function createPurchaseWindow(isGamepass, id)
local purchaseWindow = UI.Make("Window", {
Name = "Purchase window";
Title = `Purchase {isGamepass and "gamepass" or "asset"}`;
Icon = client.MatIcons["Shopping cart"];
AllowMultiple = false;
Size = {380, 160};
SizeLocked = true;
})
if purchaseWindow then
purchaseWindow:Add("TextLabel", {
Size = UDim2.new(1, -20, 1, -55);
Position = UDim2.new(0.5, 0, 0, 10);
AnchorPoint = Vector2.new(0.5, 0);
ZIndex = 2;
TextScaled = true;
Text = "This game does not allow third party purchases. If you would like to purchase, please copy the link below and put it in your browser.";
})
purchaseWindow:Add("TextBox", {
Size = UDim2.new(1, -20, 0, 30);
Position = UDim2.new(0.5, 0, 1, -10);
AnchorPoint = Vector2.new(0.5, 1);
ZIndex = 2;
ClearTextOnFocus = false;
TextEditable = false;
TextScaled = true;
Text = string.format("https://roblox.com/%s/%d/", isGamepass and "game-pass" or "library", id)
})
purchaseWindow:Ready()
end
end
local function promptPurchase(isGamepass, id)
if Variables.AllowThirdPartyPurchases == false then
createPurchaseWindow(isGamepass, id)
else
local logEvent, finishEvent
logEvent = service.LogService.MessageOut:Connect(function(msg, typ)
if typ == Enum.MessageType.MessageWarning and string.find(msg, "AllowThirdPartySales has blocked the purchase prompt") then
Variables.AllowThirdPartyPurchases = false
createPurchaseWindow(isGamepass, id)
end
end)
finishEvent = service.MarketPlace[isGamepass and "PromptGamePassPurchaseFinished" or "PromptPurchaseFinished"]:Connect(function(plr, aid)
if plr == service.Players.LocalPlayer and aid == id then
logEvent:Disconnect()
finishEvent:Disconnect()
end
end)
if isGamepass then
service.MarketPlace:PromptGamePassPurchase(service.Players.LocalPlayer, id)
else
service.MarketPlace:PromptPurchase(service.Players.LocalPlayer, id)
end
end
end
local function showTable(tab, setting)
local tabPath = type(setting) == "table" and setting
local setting = tabPath and tabPath[#tabPath-1] or setting
local name = tabPath and table.concat(tabPath, ".") or setting
local tabWindow = UI.Make("Window",{
Name = `{name}EditSettingsTable`;
Title = if #tab > 0 then `{name} ({#tab})` else name;
Size = {320, 300};
AllowMultiple = false;
})
if tabWindow then
--// Display tab & allow changes
local searchbar = tabWindow:Add("TextBox",{
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.5;
BorderSizePixel = 0;
TextColor3 = Color3.new(1, 1, 1);
Text = "";
PlaceholderText = "Search";
TextStrokeTransparency = 1;
})
local items = tabWindow:Add("ScrollingFrame", {
Size = UDim2.new(1, -10, 1, -60);
Position = UDim2.new(0, 5, 0, 30);
BackgroundTransparency = 1;
})
if tabPath and tabPath[2] == "Ranks" or canEditTables[setting] then
local selected
local inputBlock
local function showItems()
selected = nil
items:ClearAllChildren();
local fromOffset = UDim2.fromOffset
local listSize = UDim2.new(1, 0, 0, 25)
local num = 0
for i = 1, #tab do
local Value = tab[i]
items:Add("TextButton", {
Text = tabToString(Value);
Size = listSize;
Position = fromOffset(0, num*25);
Visible = true;
ZIndex = 100;
OnClicked = function(button)
if selected then
selected.Button.BackgroundTransparency = 0
end
button.BackgroundTransparency = 0.5
selected = {
Index = i;
Value = Value;
Button = button;
}
end
})
num += 1
end
items:ResizeCanvas(false, true)
end
searchbar:GetPropertyChangedSignal("Text"):Connect(function()
if searchbar.Text ~= "" then
local num = 0
local settingItems = items:GetChildren()
for i = 1, #settingItems do
local UI = settingItems[i]
if string.find(UI.Text, searchbar.Text) ~= nil then
UI.Position = UDim2.new(0, 0, 0, num*25);
UI.Visible = true
num += 1
else
UI.Visible = false
end
end
items:ResizeCanvas(false, true)
else
showItems()
end
end)
local entryText
local entryBox; entryBox = tabWindow:Add("Frame", {
Visible = false;
Size = UDim2.new(0, 241,0, 105);
BackgroundColor3 = Color3.fromRGB(45, 45, 45);
BorderColor3 = Color3.fromRGB(27, 42, 53);
Position = UDim2.new(0.434, -100,0.612, -100);
ZIndex = 100;
Children = {
{
Class = "TextLabel";
Text = "Entry";
Position = UDim2.new(0, 0, 0, 0);
Size = UDim2.new(0, 241, 0, 34);
BackgroundTransparency = 1;
TextSize = 16.000;
ZIndex = 100;
};
{
Class = "TextButton";
Text = "Add";
Position = UDim2.new(0.479, 0, 1, -30);
Size = UDim2.new(0.6, -20, 0, 20);
BackgroundTransparency = 1;
ZIndex = 100;
OnClicked = function()
if not inputBlock then
inputBlock = true
if #entryText.Text > 0 then
Remote.Send("SaveTableAdd", tabPath or setting, entryText.Text)
table.insert(tab, entryText.Text)
end
task.wait(0.5)
entryBox.Visible = false
inputBlock = false
showItems()
end
end
};
{
Class = "TextButton";
Text = "Cancel";
Position = UDim2.new(-0.041, 10, 1, -30);
Size = UDim2.new(0.5, -20, 0, 20);
BackgroundTransparency = 1;
ZIndex = 100;
OnClicked = function()
if not inputBlock then
inputBlock = false
entryBox.Visible = false
end
end
};
}
})
entryText = entryBox:Add("TextBox", {
Position = UDim2.new(0.043, 0, 0.324, 0);
Size = UDim2.new(0.928, 0, 0.238, 0);
Text = "";
PlaceholderText = "Type entry here";
TextScaled = true;
TextWrapped = true;
BackgroundColor3 = Color3.fromRGB(58, 58, 58);
BackgroundTransparency = 0;
ZIndex = 100;
})
tabWindow:Add("TextButton", {
Text = "Remove";
Position = UDim2.new(0, 5, 1, -25);
Size = UDim2.new(0.5, -10, 0, 20);
OnClicked = function(button)
if selected and not inputBlock then
inputBlock = true
Remote.Send("SaveTableRemove", tabPath or setting, selected.Value)
table.remove(tab, selected.Index)
showItems()
task.wait(0.5)
inputBlock = false
end
end
})
tabWindow:Add("TextButton", {
Text = "Add",
Position = UDim2.new(0.5, 0, 1, -25);
Size = UDim2.new(0.5, -5, 0, 20);
OnClicked = function()
if not inputBlock then
entryText.Text = ""
entryBox.Visible = true
end
end
})
--entryBox.BackgroundColor3 = entryBox.BackgroundColor3:lerp(Color3.new(1,1,1), 0.25)
showItems()
else
items:Add("TextLabel", {
Text = "Cannot edit this table in-game";
Size = UDim2.new(1, 0, 0, 25);
Position = UDim2.new(0, 0, 0, 0);
})
end
tabWindow:Ready()
end
end
if window then
local commandPrefix = ":"
local playerData, chatMod, settingsData
local tabFrame = window:Add("TabFrame", {
Size = UDim2.new(1, -10, 1, -10);
Position = UDim2.new(0, 5, 0, 5);
})
local infoTab = tabFrame:NewTab("Info", {
Text = "Info";
})
local donorTab = tabFrame:NewTab("Donate", {
Text = "Donate";
})
local keyTab = tabFrame:NewTab("Keybinds", {
Text = "Keybinds";
})
local aliasTab = tabFrame:NewTab("Aliases", {
Text = "Aliases";
})
local clientTab = tabFrame:NewTab("Client", {
Text = "Client";
})
local gameTab = tabFrame:NewTab("Game", {
Text = "Game";
})
if data.Tab then
local Tab = string.lower(data.Tab)
if Tab == "donate" then
donorTab:FocusTab()
elseif Tab == "keybinds" then
keyTab:FocusTab()
elseif Tab == "aliases" then
aliasTab:FocusTab()
elseif Tab == "client" then
clientTab:FocusTab()
elseif Tab == "settings" then
gameTab:FocusTab()
else
infoTab:FocusTab()
end
end
--// Help/Info
do
infoTab:Add("TextLabel", {
Text = "Adonis is a frequently updated, community maintained, open source administration system created by Sceleratis (Davey_Bones). \n\nIts purpose is to assist in the\nadministration and moderation\nof Roblox game servers.\n\nFeel free to take and edit it on\nthe condition that existing credits remain.\nHave an idea? Let us know!";
TextWrapped = true;
Size = UDim2.new(1, -145, 1, -10);
Position = UDim2.new(0, 5, 0, 5);
})
infoTab:Add("TextButton", {
Text = "Commands";
Size = UDim2.new(0, 130, 0, 40);
Position = UDim2.new(1, -135, 0, 5);
BackgroundTransparency = 0.5;
Events = {
MouseButton1Down = function()
Remote.Send("ProcessCommand", `{commandPrefix}cmds`)
end
}
})
infoTab:Add("TextButton", {
Text = "Changelog";
Size = UDim2.new(0, 130, 0, 40);
Position = UDim2.new(1, -135, 0, 50);
BackgroundTransparency = 0.5;
Events = {
MouseButton1Down = function()
UI.Make("List", {
Title = "Changelog";
Table = client.FormattedChangelog;
RichText = true;
Size = {500, 400};
})
end
}
})
infoTab:Add("TextButton", {
Text = "Credits";
Size = UDim2.new(0, 130, 0, 40);
Position = UDim2.new(1, -135, 0, 95);
BackgroundTransparency = 0.5;
Events = {
MouseButton1Down = function()
UI.Make("Credits", {})
end
}
})
infoTab:Add("TextButton", {
Text = "Get Loader";
Size = UDim2.new(0, 130, 0, 40);
Position = UDim2.new(1, -135, 0, 140);
BackgroundTransparency = 0.5;
Events = {
MouseButton1Down = function()
promptPurchase(false, 7510622625)
end
}
}):Add("ImageLabel", {
BackgroundTransparency = 1;
Image = "rbxassetid://7346570801";
ImageTransparency = 0.2;
Size = UDim2.new(0, 18, 0, 18);
Position = UDim2.new(1, -22, 0, 4);
})
infoTab:Add("TextButton", {
Text = "Get Source";
Size = UDim2.new(0, 130, 0, 40);
Position = UDim2.new(1, -135, 0, 185);
BackgroundTransparency = 0.5;
Events = {
MouseButton1Down = function()
promptPurchase(false, 7510592873)
end
}
}):Add("ImageLabel", {
BackgroundTransparency = 1;
Image = "rbxassetid://7346570801";
ImageTransparency = 0.2;
Size = UDim2.new(0, 18, 0, 18);
Position = UDim2.new(1, -22, 0, 4);
})
end
local LOAD_ICON = {
BackgroundTransparency = 1;
Size = UDim2.new(0, 14, 0, 14);
Position = UDim2.new(0.5, 0, 0.5, 0);
AnchorPoint = Vector2.new(0.5, 0.5);
Image = "rbxassetid://69395121";
ImageTransparency = 0.1;
ZIndex = 10;
}
local loadingIcons = {donorTab:Add("ImageLabel", LOAD_ICON), keyTab:Add("ImageLabel", LOAD_ICON), aliasTab:Add("ImageLabel", LOAD_ICON), clientTab:Add("ImageLabel", LOAD_ICON), gameTab:Add("ImageLabel", LOAD_ICON)}
gTable = window.gTable
window:Ready()
task.spawn(function()
local start = os.clock()
while loadingIcons[1].Parent do
for _, v in loadingIcons do
v.Rotation = -(os.clock() - start)/(1/60)*10
end
task.wait(1/60)
end
end)
playerData = Remote.Get("PlayerData")
chatMod = Remote.Get("Setting",{"Prefix","SpecialPrefix","BatchKey","AnyPrefix","DonorCommands","DonorCapes"})
settingsData = Remote.Get("AllSettings")
Variables.Aliases = playerData.Aliases or {}
commandPrefix = if type(chatMod.Prefix) == "table" then chatMod.Prefix[1] else chatMod.Prefix
for _, v in loadingIcons do
v:Destroy()
end
--// Donor Tab
do
local donorData = playerData.Donor
local currentMaterial = donorData and donorData.Cape.Material
local currentTexture = donorData and donorData.Cape.Image
local currentColor = donorData and donorData.Cape.Color
if type(currentColor) == "table" then
currentColor = Color3.new(unpack(currentColor, 1, 3))
else
currentColor = BrickColor.new(currentColor).Color
end
local dStatus = donorTab:Add("TextLabel", {
Text = " Donor Status: ";
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.25;
TextXAlignment = "Left";
}):Add("TextLabel", {
Text = (playerData.isDonor and "Donated") or "Not a Donor";
Size = UDim2.new(0, 150, 1, 0);
Position = UDim2.new(1, -155, 0, 0);
BackgroundTransparency = 1;
TextXAlignment = "Right";
})
local function updateStatus()
dStatus.Text = "Updating..."
if chatMod.DonorCapes and playerData.isDonor then
if type(donorData) == "table" and donorData.Cape and type(donorData.Cape) == "table" then
if donorData.Enabled and service.Players.LocalPlayer.Character then
Functions.NewCape({
Color = type(currentColor) == "table" and Color3.new(unpack(currentColor)) or currentColor or "White";
Parent = service.Players.LocalPlayer.Character;
Material = donorData.Cape.Material or "Neon";
--Reflectance = reflect;
Decal = donorData.Cape.Image;
})
elseif service.Players.LocalPlayer.Character then
Functions.RemoveCape(service.Players.LocalPlayer.Character)
end
end
end
task.defer(function()
dStatus.Text = Remote.Get("UpdateDonor", playerData.Donor)
task.wait(0.5)
dStatus.Text = "Donated"
end)
end
donorTab:Add("TextLabel", {
Text = " Donor Cape: ";
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 25);
BackgroundTransparency = 0.8;
TextXAlignment = "Left";
Children = {
{
Class = "Boolean";
TextXAlignment = "Right";
Size = UDim2.new(0, 150, 1, 0);
Position = UDim2.new(1, -155, 0, 0);
TextTransparency = (playerData.isDonor and 0) or 0.5;
BackgroundTransparency = 1;
Enabled = playerData.isDonor and playerData.Donor.Enabled;
OnToggle = playerData.isDonor and function(enabled)
service.Debounce("DonorStatusUpdate", function()
playerData.Donor.Enabled = enabled
updateStatus()
end)
end
}
}
})
donorTab:Add("TextLabel", {
Text = " Cape Color: ";
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 45);
BackgroundTransparency = 0.25;
TextXAlignment = "Left";
Children = {
{
Class = "TextButton";
Text = "";
Size = UDim2.new(0, 40, 1, -6);
Position = UDim2.new(1, -45, 0, 3);
BackgroundColor3 = currentColor;
TextTransparency = (playerData.isDonor and 0) or 0.5;
BackgroundTransparency = 0;
BorderPixelSize = 1;
BorderColor3 = Color3.fromRGB(100, 100, 100);
OnClick = playerData.isDonor and function(new)
service.Debounce("DonorStatusUpdate", function()
local newColor = UI.Make("ColorPicker", {
Color = currentColor;
})
currentColor = newColor or currentColor
new.BackgroundColor3 = currentColor
donorData.Cape.Color = {currentColor.R; currentColor.G; currentColor.B;}
updateStatus()
end)
end
}
}
})
donorTab:Add("TextLabel", {
Text = " Cape Material: ";
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 65);
BackgroundTransparency = 0.8;
TextXAlignment = "Left";
Children = {
{
Class = "Dropdown";
Size = UDim2.new(0, 100, 1, 0);
Position = UDim2.new(1, -105, 0, 0);
BackgroundTransparency = 1;
Selected = currentMaterial;
TextAlignment = "Right";
NoArrow = true;
TextProperties = {
TextTransparency = (playerData.isDonor and 0) or 0.5;
};
Options = playerData.isDonor and {
"Brick";
"Cobblestone";
"Concrete";
"CorrodedMetal";
"DiamondPlate";
"Fabric";
"Foil";
"ForceField";
"Granite";
"Grass";
"Ice";
"Marble";
"Metal";
"Neon";
"Pebble";
"Plastic";
"Sand";
"Slate";
"SmoothPlastic";
"Wood";
"WoodPlanks";
"Glass";
};
OnSelect = function(selection)
service.Debounce("DonorStatusUpdate", function()
donorData.Cape.Material = selection
updateStatus()
end)
end;
}
}
})
donorTab:Add("TextLabel", {
Text = " Cape Texture: ";
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 85);
BackgroundTransparency = 0.25;
TextXAlignment = "Left";
Children = {
{
Class = "TextButton";
TextXAlignment = "Right";
Text = currentTexture or 0;
Size = UDim2.new(0, 100, 1, 0);
Position = UDim2.new(1, -105, 0, 0);
TextTransparency = (playerData.isDonor and 0) or 0.5;
BackgroundTransparency = 1;
OnClick = playerData.isDonor and function(textureButton)
service.Debounce("DonorStatusUpdate", function()
local lastValid = currentTexture
local donePreview = false
local pWindow = UI.Make("Window", {
Name = "CapeTexture";
Title = "Texture Preview";
Size = {200, 250};
Ready = true;
OnClose = function()
donePreview = true;
end
})
local img = pWindow:Add("ImageLabel", {
BackgroundTransparency = 1;
Image = `rbxthumb://type=Asset&id={currentTexture}&w=420&h=420`;
Size = UDim2.new(1, -10, 1, -80);
Position = UDim2.new(0, 5, 0, 35);
})
local lastChange = 0;
pWindow:Add("TextBox", {
Text = currentTexture;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, 5);
TextChanged = function(text, enter, new)
local lastVal = math.random();
lastChange = lastVal;
delay(0.5, function()
if lastChange == lastVal then --// So we only do the update when they finish typing
local num = tonumber(text)
if num then
lastValid = num
img.Image = `rbxthumb://type=Asset&id={num}&w=420&h=420`;
else
new.Text = lastValid
end
end
end)
end
})
pWindow:Add("TextButton", {
Text = "Select";
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 1, -35);
OnClick = function(new)
currentTexture = lastValid;
donorData.Cape.Image = lastValid;
textureButton.Text = lastValid;
donePreview = true;
pWindow:Close()
updateStatus()
end
})
end)
end
}
}
})
local donorPerks = {
"Perks you get here: "
}
local capePerks,cmdPerks = {
"Customizable Cape (see above)";
"Access to !cape";
"Access to !uncape";
},{
"Access to !sparkles <BrickColor>";
"Access to !unsparkles";
"Access to !particle <textureID> <startColor3> <endColor3>";
"Access to !unparticle";
"Access to !fire <BrickColor>";
"Access to !unfire";
"Access to !light <BrickColor>";
"Access to !unlight";
"Access to !avataritem/!hat/!shirt/!pants <ID>";
"Access to !myhats";
"Access to !removehat <name>";
"Access to !removehats";
"Access to !neon <BrickColor>";
"Access to !removetshirt";
}
if chatMod.DonorCapes then
for _, v in ipairs(capePerks) do
table.insert(donorPerks, v)
end
else
table.insert(donorPerks, "Donor capes are disabled here")
end
if chatMod.DonorCommands then
for _, v in ipairs(cmdPerks) do
table.insert(donorPerks, v)
end
else
table.insert(donorPerks, "Donor commands are disabled here")
end
donorTab:Add("ScrollingFrame", {
Size = UDim2.new(1, -145, 1, -115);
Position = UDim2.new(0, 5, 0, 110);
}):GenerateList(donorPerks, {
TextXAlignment = "Left";
})
local dFrame = donorTab:Add("Frame", {
Size = UDim2.new(0, 140, 1, -110);
Position = UDim2.new(1, -140, 0, 105);
BackgroundTransparency = 1;
})
dFrame:Add("TextButton", {
Text = "Donate (Perks)";
Size = UDim2.new(1, -10, 0, 40);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.5;
BackgroundColor3 = Color3.fromRGB(231, 6, 141);
OnClick = function()
promptPurchase(true, 1348327) --497917601)
end
})
dFrame:Add("TextLabel", {
Text = "Extra (No Perks): ";
TextXAlignment = "Left";
Size = UDim2.new(1, 0, 0, 30);
Position = UDim2.new(0, 5, 1, -80);
BackgroundTransparency = 1;
})
dFrame:Add("TextButton", {
Text = "50";
Size = UDim2.new(0, 60, 0, 20);
Position = UDim2.new(0, 5, 1, -50);
BackgroundTransparency = 0.7;
BackgroundColor3 = Color3.new(0,1,0):lerp(Color3.new(1,0,0), 0.1);
OnClick = function()
promptPurchase(true, 5212076)
end
})
dFrame:Add("TextButton", {
Text = "100";
Size = UDim2.new(0, 60, 0, 20);
Position = UDim2.new(0.5, 5, 1, -50);
BackgroundTransparency = 0.5;
BackgroundColor3 = Color3.new(0,1,0):lerp(Color3.new(1,0,0), 0.3);
OnClick = function()
promptPurchase(true, 5212077)
end
})
dFrame:Add("TextButton", {
Text = "500";
Size = UDim2.new(0, 60, 0, 20);
Position = UDim2.new(0, 5, 1, -25);
BackgroundTransparency = 0.5;
BackgroundColor3 = Color3.new(0,1,0):lerp(Color3.new(1,0,0), 0.6);
OnClick = function()
promptPurchase(true, 5212081)
end
})
dFrame:Add("TextButton", {
Text = "1000";
Size = UDim2.new(0, 60, 0, 20);
Position = UDim2.new(0.5, 5, 1, -25);
BackgroundTransparency = 0.5;
BackgroundColor3 = Color3.new(0,1,0):lerp(Color3.new(1,0,0), 0.9);
OnClick = function()
promptPurchase(true, 5212082)
end
})
end
--// Keybinds
do
local doneKey
local selected
local orgTextTransparency, editButton, removeButton
local autoButtonColor = false
local currentKey
local editOldKeybind
local keyInputHandler
local curCommandText = ""
local waitingForBind = false
local keyDebounce = false
local inputBlock = false
local commandBox
local keyBox
local binds = keyTab:Add("ScrollingFrame", {
Size = UDim2.new(1, -10, 1, -60);
Position = UDim2.new(0, 5, 0, 30);
BackgroundTransparency = 0.5;
})
local searchbar:TextBox = keyTab:Add("TextBox",{
Size = UDim2.new(1, -10, 0, 20);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.5;
BorderSizePixel = 0;
TextColor3 = Color3.new(1, 1, 1);
Text = "";
PlaceholderText = "Search";
TextStrokeTransparency = 1;
})
local function getBinds()
local num = 0
selected = nil
binds:ClearAllChildren();
for i,v in Variables.KeyBinds do
binds:Add("TextButton", {
Text = `Key: {string.upper(keyCodeToName(i))} | Command: {v}`;
Size = UDim2.new(1, 0, 0, 25);
Position = UDim2.new(0, 0, 0, num*25);
OnClicked = function(button)
if selected then
selected.Button.BackgroundTransparency = 0
if autoButtonColor then selected.Button.AutoButtonColor = true end
end
if not (selected and selected.Button == button) then
button.BackgroundTransparency = 0.5
if autoButtonColor then button.AutoButtonColor = false end
selected = {
Key = i;
Command = v;
Button = button;
}
editButton.TextTransparency = orgTextTransparency
removeButton.TextTransparency = orgTextTransparency
if autoButtonColor then
editButton.AutoButtonColor = true
removeButton.AutoButtonColor = true
end
else
selected = nil
editButton.TextTransparency = 0.5
removeButton.TextTransparency = 0.5
if autoButtonColor then
editButton.AutoButtonColor = false
removeButton.AutoButtonColor = false
end
end
end
})
num += 1
end
binds:ResizeCanvas(false, true)
end
searchbar.Changed:Connect(function()
if searchbar.Text ~= "" then
local num = 0
for i,UI: TextButton in pairs(binds:GetChildren()) do
if string.find(UI.Text, searchbar.Text) ~= nil then
UI.Visible = true
UI.Position = UDim2.new(0, 0, 0, num*25);
num += 1
else
UI.Visible = false
end
end
binds:ResizeCanvas(false, true)
else
getBinds()
end
end)
local binderBox; binderBox = keyTab:Add("Frame", {
Visible = false;
Size = UDim2.new(0, 220, 0, 150);
Position = UDim2.new(0.5, -100, 0.5, -100);
Children = {
{
Class = "TextLabel";
Text = "Command:";
Position = UDim2.new(0, 0, 0, 10);
Size = UDim2.new(1, 0, 0, 20);
BackgroundTransparency = 1;
};
{
Class = "TextLabel";
Text = "Key:";
Position = UDim2.new(0, 0, 0, 65);
Size = UDim2.new(1, 0, 0, 20);
BackgroundTransparency = 1;
};
{
Class = "TextButton";
Text = "Add";
Position = UDim2.new(0.5, 0, 1, -30);
Size = UDim2.new(0.5, -20, 0, 20);
BackgroundTransparency = 1;
OnClicked = function()
inputBlock = true
if currentKey then
keyBox.Text = "Saving..."