Repository navigation
Expand file tree
/
Copy pathMiniTeamCreate.lua
More file actions
2654 lines (2419 loc) · 153 KB
/
Copy pathMiniTeamCreate.lua
File metadata and controls
2654 lines (2419 loc) · 153 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 PLUGIN_NAME = "MiniTeamCreate"
local PLUGIN_VERSION = "v1.0"
local PLUGIN_ICON = ""
local HttpService = game:GetService("HttpService")
local Selection = game:GetService("Selection")
local Players = game:GetService("Players")
local StudioService = game:GetService("StudioService")
local StarterPlayer = game:GetService("StarterPlayer")
local InsertService = game:GetService("InsertService")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local SoundService = game:GetService("SoundService")
local CollectionService = game:GetService("CollectionService")
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local ScriptEditorService, TeamsService, MaterialService, TextChatService = nil, nil, nil, nil
pcall(function() ScriptEditorService = game:GetService("ScriptEditorService") end)
pcall(function() TeamsService = game:GetService("Teams") end)
pcall(function() MaterialService = game:GetService("MaterialService") end)
pcall(function() TextChatService = game:GetService("TextChatService") end)
local PEER_PALETTE = {
{ 0.23, 0.51, 0.96 }, { 0.96, 0.36, 0.42 }, { 0.20, 0.80, 0.50 },
{ 0.96, 0.68, 0.20 }, { 0.68, 0.44, 0.98 }, { 0.14, 0.78, 0.85 },
}
local function loadSetting(key, fallback)
local ok, val = pcall(function() return plugin:GetSetting(key) end)
return (ok and val ~= nil) and val or fallback
end
local function saveSetting(key, val)
pcall(function() plugin:SetSetting(key, val) end)
end
local function getLocalUserId()
local ok, uid = pcall(function() return StudioService:GetUserId() end)
return (ok and type(uid) == "number" and uid > 0) and uid or 0
end
local function getAvatarThumb(userId)
return (type(userId) == "number" and userId > 0)
and ("rbxthumb://type=AvatarHeadShot&id=" .. tostring(userId) .. "&w=100&h=100") or ""
end
local function isFinite(n)
return type(n) == "number" and n == n and n ~= math.huge and n ~= -math.huge
end
local function packCF(cf)
local c = { cf:GetComponents() }
for i = 1, 12 do if not isFinite(c[i]) then return nil end end
return c
end
-- =========================================================================
-- РЕЖИМ 1: MINI TEAM TEST (PLAY MODE / SERVER)
-- =========================================================================
if RunService:IsRunning() then
if not RunService:IsServer() then return end
if not loadSetting("MiniTC_Connected", false) or loadSetting("MiniTC_TeamTest", true) == false then return end
local testUrl = loadSetting("MiniTC_Url", "http://127.0.0.1:34872")
if testUrl == "" then return end
local testClientId = "test_" .. HttpService:GenerateGUID(false)
local myUserId = getLocalUserId()
local myNick = loadSetting("MiniTC_Nick", "Player")
local cIdx = ((tonumber(loadSetting("MiniTC_ColorIdx", 1)) or 1) - 1) % #PEER_PALETTE + 1
local myColor = PEER_PALETTE[cIdx]
local function testReq(method, path, bodyTable)
local req = { Url = testUrl .. path, Method = method, Headers = { ["Content-Type"] = "application/json" } }
if bodyTable then req.Body = HttpService:JSONEncode(bodyTable) end
local ok, res = pcall(function() return HttpService:RequestAsync(req) end)
if not ok or not res.Success then return nil end
local dOk, dec = pcall(function() return HttpService:JSONDecode(res.Body) end)
return dOk and dec or nil
end
if not testReq("GET", "/ping") then return end
local running = true
local ghostsFolder = Instance.new("Folder")
ghostsFolder.Name = "_MiniTC_TeamTest"; ghostsFolder.Archivable = false; ghostsFolder.Parent = workspace
local ghosts, latestPeerData = {}, {}
local function attachTag(head, name, userId, col)
if not head then return end
local bb = Instance.new("BillboardGui")
bb.Size = UDim2.new(0, 152, 0, 30); bb.StudsOffset = Vector3.new(0, 2.3, 0)
bb.AlwaysOnTop = true; bb.MaxDistance = 120; bb.Adornee = head; bb.Parent = head
local pill = Instance.new("Frame"); pill.Size = UDim2.fromScale(1, 1)
pill.BackgroundColor3 = Color3.fromRGB(18, 19, 24); pill.BackgroundTransparency = 0.15; pill.Parent = bb
local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, 15); c.Parent = pill
local st = Instance.new("UIStroke"); st.Color = col; st.Thickness = 1.5; st.Parent = pill
local thumb, off = getAvatarThumb(userId), 10
if thumb ~= "" then
local ava = Instance.new("ImageLabel"); ava.Size = UDim2.new(0, 22, 0, 22); ava.Position = UDim2.new(0, 4, 0.5, -11)
ava.BackgroundColor3 = col; ava.Image = thumb; ava.Parent = pill
local ac = Instance.new("UICorner"); ac.CornerRadius = UDim.new(1, 0); ac.Parent = ava; off = 30
end
local lbl = Instance.new("TextLabel"); lbl.Size = UDim2.new(1, -off - 8, 1, 0); lbl.Position = UDim2.new(0, off, 0, 0)
lbl.BackgroundTransparency = 1; lbl.Font = Enum.Font.GothamBold; lbl.TextSize = 12; lbl.TextColor3 = Color3.fromRGB(241, 245, 249)
lbl.TextXAlignment = Enum.TextXAlignment.Left; lbl.TextTruncate = Enum.TextTruncate.AtEnd; lbl.Text = name; lbl.Parent = pill
end
local function spawnGhost(peer)
local pid = peer.clientId
ghosts[pid] = { spawning = true }; latestPeerData[pid] = peer
task.spawn(function()
local col = Color3.new((peer.color and peer.color[1]) or 0.23, (peer.color and peer.color[2]) or 0.51, (peer.color and peer.color[3]) or 0.96)
local uid = peer.userId or 0
if uid == 0 and peer.name and peer.name ~= "" then pcall(function() uid = Players:GetUserIdFromNameAsync(peer.name) end) end
local model = nil
if uid > 0 then local ok, res = pcall(function() return Players:CreateHumanoidModelFromUserId(uid) end); if ok and res then model = res end end
if not model then
model = Instance.new("Model")
local hrp = Instance.new("Part"); hrp.Name = "HumanoidRootPart"; hrp.Size = Vector3.new(2, 2, 1); hrp.Color = col; hrp.Anchored = true; hrp.CanCollide = false; hrp.Parent = model
local hum = Instance.new("Humanoid"); hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None; hum.Parent = model
model.PrimaryPart = hrp
end
if not running or not ghosts[pid] then model:Destroy(); return end
model.Name = "TeamTest_" .. peer.name; model.Archivable = false
for _, d in ipairs(model:GetDescendants()) do
if d:IsA("BaseScript") then d:Destroy()
elseif d:IsA("BasePart") then d.CanCollide = false; d.CanTouch = false; d.CanQuery = false; d.Massless = true end
end
local hrp = model:FindFirstChild("HumanoidRootPart") or model.PrimaryPart
local head = model:FindFirstChild("Head") or hrp
local hum = model:FindFirstChildOfClass("Humanoid")
if hum then hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None end
local fresh = latestPeerData[pid] or peer
if hrp then hrp.Anchored = true; if fresh.cframe then hrp.CFrame = CFrame.new(table.unpack(fresh.cframe)) end end
attachTag(head, peer.name, uid, col); model.Parent = ghostsFolder
local tracks = {}
if hum then
pcall(function()
local anim = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator", hum)
local ids = (hum.RigType == Enum.HumanoidRigType.R15)
and { idle = "rbxassetid://507766666", walk = "rbxassetid://507777826", jump = "rbxassetid://507765000" }
or { idle = "rbxassetid://180435571", walk = "rbxassetid://180426354", jump = "rbxassetid://125750702" }
for k, aid in pairs(ids) do
local a = Instance.new("Animation"); a.AnimationId = aid
local tr = anim:LoadAnimation(a); tr.Looped = (k ~= "jump"); tracks[k] = tr
end
if tracks.idle then tracks.idle:Play() end
end)
end
ghosts[pid] = { spawning = false, model = model, hrp = hrp, targetCFrame = hrp and hrp.CFrame or nil, tracks = tracks, currentAnim = "idle" }
end)
end
local hbConn = RunService.Heartbeat:Connect(function(dt)
local alpha = 1 - math.exp(-15 * math.min(dt, 0.1))
for _, g in pairs(ghosts) do
if not g.spawning and g.hrp and g.hrp.Parent and g.targetCFrame then
g.hrp.CFrame = ((g.hrp.Position - g.targetCFrame.Position).Magnitude > 40) and g.targetCFrame or g.hrp.CFrame:Lerp(g.targetCFrame, alpha)
end
end
end)
plugin.Unloading:Connect(function()
if not running then return end
running = false
if hbConn then hbConn:Disconnect() end
pcall(function() testReq("POST", "/test/leave", { clientId = testClientId }) end)
if ghostsFolder then pcall(function() ghostsFolder:Destroy() end) end
end)
task.spawn(function()
while running do
local lp = Players:GetPlayers()[1]
local char = lp and lp.Character
local hrp = char and char:FindFirstChild("HumanoidRootPart")
local hum = char and char:FindFirstChildOfClass("Humanoid")
local res = testReq("POST", "/test/sync", {
clientId = testClientId, userId = myUserId, name = myNick, color = myColor,
cframe = hrp and packCF(hrp.CFrame) or nil,
moveMag = hum and hum.MoveDirection.Magnitude or 0,
state = hum and hum:GetState().Name or "Running",
})
if res and res.players then
local seen = {}
for _, peer in ipairs(res.players) do
seen[peer.clientId] = true; latestPeerData[peer.clientId] = peer
local g = ghosts[peer.clientId]
if not g then spawnGhost(peer)
elseif not g.spawning then
if peer.cframe then g.targetCFrame = CFrame.new(table.unpack(peer.cframe)) end
local desired = (peer.state == "Jumping" or peer.state == "Freefall") and "jump"
or ((peer.moveMag or 0) > 0.1 and "walk" or "idle")
if desired ~= g.currentAnim and g.tracks then
if g.tracks[g.currentAnim] then pcall(function() g.tracks[g.currentAnim]:Stop(0.15) end) end
if g.tracks[desired] then pcall(function() g.tracks[desired]:Play(0.15) end) end
g.currentAnim = desired
end
end
end
for pid, g in pairs(ghosts) do
if not seen[pid] then if g.model then pcall(function() g.model:Destroy() end) end; ghosts[pid] = nil; latestPeerData[pid] = nil end
end
end
task.wait(0.1)
end
end)
return
end
-- =========================================================================
-- РЕЖИМ 2: РЕДАКТОР (EDIT MODE v1.0)
-- =========================================================================
if not RunService:IsEdit() then return end
local leftoverTest = workspace:FindFirstChild("_MiniTC_TeamTest")
if leftoverTest then leftoverTest:Destroy() end
local Terrain = workspace.Terrain
local TERRAIN_CHUNK = 32
local TERRAIN_MAX_CHUNKS = 2400
local RENDER_BIND_NAME = "MiniTC_RenderV10"
local MAT_BY_VAL = {}
for _, m in ipairs(Enum.Material:GetEnumItems()) do MAT_BY_VAL[m.Value] = m end
local LIGHTING_ID = "SERVICE:Lighting"
local STARTER_PLAYER_ID = "SERVICE:StarterPlayer"
local TERRAIN_SVC_ID = "SERVICE:Terrain"
local WORKSPACE_SVC_ID = "SERVICE:Workspace"
local HEAD_ATTACHMENTS = { HatAttachment = true, HairAttachment = true, FaceFrontAttachment = true, FaceCenterAttachment = true }
local TERRAIN_KEYWORDS = {
"terrain", "sculpt", "paint", "smooth", "flatten", "erode", "grow",
"fill", "clear", "generate", "sea", "subtract", "replace", "voxel", "region", "convert",
}
local ROOTS = {
Workspace = workspace,
Terrain = Terrain,
ReplicatedFirst = game:GetService("ReplicatedFirst"),
ReplicatedStorage = game:GetService("ReplicatedStorage"),
ServerScriptService = game:GetService("ServerScriptService"),
ServerStorage = game:GetService("ServerStorage"),
StarterGui = game:GetService("StarterGui"),
StarterPack = game:GetService("StarterPack"),
Lighting = Lighting,
SoundService = SoundService,
Teams = TeamsService,
MaterialService = MaterialService,
TextChatService = TextChatService,
TextChannels = TextChatService and TextChatService:FindFirstChild("TextChannels"),
TextChatCommands = TextChatService and TextChatService:FindFirstChild("TextChatCommands"),
StarterPlayer = StarterPlayer,
StarterPlayerScripts = StarterPlayer:FindFirstChild("StarterPlayerScripts"),
StarterCharacterScripts = StarterPlayer:FindFirstChild("StarterCharacterScripts"),
}
-- ROOT_LIST содержит только независимые корневые деревья (Terrain обходится через Workspace без дубля)
local ROOT_LIST, ROOT_KEY_MAP = {}, {}
for name, inst in pairs(ROOTS) do
if inst then ROOT_KEY_MAP[inst] = "ROOT:" .. name end
end
for _, name in ipairs({
"Workspace", "ReplicatedStorage", "ServerScriptService", "ServerStorage",
"StarterGui", "StarterPack", "Lighting", "SoundService", "Teams",
"MaterialService", "TextChatService", "ReplicatedFirst", "StarterPlayer",
}) do
local inst = ROOTS[name]
if inst then table.insert(ROOT_LIST, inst) end
end
local TEXTCHAT_BUILTINS = {
TextChannels = true, TextChatCommands = true,
ChatWindowConfiguration = true, ChatInputBarConfiguration = true, BubbleChatConfiguration = true,
}
-- Формат свойства: { name, type, enumOrRefClass, readOnly }
local CLASS_SPECS = {
{ class = "Model", props = { { "PrimaryPart", "ref", "BasePart" }, { "WorldPivot", "cf" } } },
{ class = "BasePart", props = {
{ "Size", "v3" }, { "CFrame", "cf" }, { "PivotOffset", "cf" }, { "Color", "c3" },
{ "Anchored", "p" }, { "CanCollide", "p" }, { "CanTouch", "p" }, { "CanQuery", "p" }, { "Massless", "p" },
{ "Locked", "p" }, { "Transparency", "p" }, { "Reflectance", "p" }, { "CastShadow", "p" },
{ "Material", "en", "Material" }, { "MaterialVariant", "p" }, { "CollisionGroup", "p" },
}},
{ class = "Part", props = { { "Shape", "en", "PartType" } } },
{ class = "MeshPart", props = {
{ "MeshId", "p", nil, true }, { "TextureID", "p" },
{ "CollisionFidelity", "en", "CollisionFidelity", true }, { "RenderFidelity", "en", "RenderFidelity", true },
}},
{ class = "SpawnLocation", props = {
{ "TeamColor", "bc" }, { "Neutral", "p" }, { "Duration", "p" }, { "AllowTeamChangeOnTouch", "p" }, { "Enabled", "p" },
}},
{ class = "VehicleSeat", props = {
{ "MaxSpeed", "p" }, { "Torque", "p" }, { "TurnSpeed", "p" }, { "HeadsUpDisplay", "p" }, { "Disabled", "p" },
}},
{ class = "Tool", props = {
{ "Grip", "cf" }, { "RequiresHandle", "p" }, { "CanBeDropped", "p" }, { "TextureId", "p" },
{ "ToolTip", "p" }, { "Enabled", "p" }, { "ManualActivationOnly", "p" },
}},
{ class = "SurfaceAppearance", props = {
{ "ColorMap", "p" }, { "MetalnessMap", "p" }, { "NormalMap", "p" }, { "RoughnessMap", "p" },
{ "Color", "c3" }, { "AlphaMode", "en", "AlphaMode" },
}},
{ class = "MaterialVariant", props = {
{ "BaseMaterial", "en", "Material" }, { "ColorMap", "p" }, { "MetalnessMap", "p" }, { "NormalMap", "p" },
{ "RoughnessMap", "p" }, { "StudsPerTile", "p" }, { "MaterialPattern", "en", "MaterialPattern" },
}},
{ class = "Clouds", props = { { "Cover", "p" }, { "Density", "p" }, { "Color", "c3" }, { "Enabled", "p" } } },
{ class = "Team", props = { { "TeamColor", "bc" }, { "AutoAssignable", "p" } } },
{ class = "TextChatCommand", props = { { "PrimaryAlias", "p" }, { "SecondaryAlias", "p" }, { "Enabled", "p" }, { "AutocompleteVisible", "p" } } },
{ class = "Attachment", props = { { "CFrame", "cf" }, { "Visible", "p" } } },
{ class = "Decal", props = { { "Texture", "p" }, { "Color3", "c3" }, { "Transparency", "p" }, { "Face", "en", "NormalId" } } },
{ class = "Texture", props = { { "StudsPerTileU", "p" }, { "StudsPerTileV", "p" }, { "OffsetStudsU", "p" }, { "OffsetStudsV", "p" } } },
{ class = "SpecialMesh", props = { { "MeshId", "p" }, { "TextureId", "p" }, { "MeshType", "en", "MeshType" }, { "Scale", "v3" } } },
{ class = "Highlight", props = { { "Enabled", "p" }, { "FillColor", "c3" }, { "OutlineColor", "c3" }, { "FillTransparency", "p" }, { "OutlineTransparency", "p" } } },
{ class = "ClickDetector", props = { { "MaxActivationDistance", "p" }, { "CursorIcon", "p" } } },
{ class = "ProximityPrompt", props = { { "ActionText", "p" }, { "ObjectText", "p" }, { "HoldDuration", "p" }, { "MaxActivationDistance", "p" }, { "Enabled", "p" } } },
{ class = "PathfindingModifier", props = { { "Label", "p" }, { "PassThrough", "p" } } },
-- Физика и соединения
{ class = "WeldConstraint", disableWhileLinking = true, props = { { "Part0", "ref", "BasePart" }, { "Part1", "ref", "BasePart" }, { "Enabled", "p" } } },
{ class = "Weld", disableWhileLinking = true, props = { { "Part0", "ref", "BasePart" }, { "Part1", "ref", "BasePart" }, { "C0", "cf" }, { "C1", "cf" }, { "Enabled", "p" } } },
{ class = "Motor6D", disableWhileLinking = true, props = {
{ "Part0", "ref", "BasePart" }, { "Part1", "ref", "BasePart" }, { "C0", "cf" }, { "C1", "cf" },
{ "MaxVelocity", "p" }, { "DesiredAngle", "p" }, { "Enabled", "p" },
}},
{ class = "NoCollisionConstraint", props = { { "Part0", "ref", "BasePart" }, { "Part1", "ref", "BasePart" }, { "Enabled", "p" } } },
{ class = "HingeConstraint", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "ActuatorType", "en", "ActuatorType" },
{ "AngularVelocity", "p" }, { "MotorMaxTorque", "p" }, { "TargetAngle", "p" }, { "LimitsEnabled", "p" },
{ "LowerAngle", "p" }, { "UpperAngle", "p" }, { "Enabled", "p" }, { "Visible", "p" },
}},
{ class = "PrismaticConstraint", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "ActuatorType", "en", "ActuatorType" },
{ "LimitsEnabled", "p" }, { "LowerLimit", "p" }, { "UpperLimit", "p" }, { "Velocity", "p" },
{ "MotorMaxForce", "p" }, { "TargetPosition", "p" }, { "ServoMaxForce", "p" }, { "Speed", "p" }, { "Enabled", "p" }, { "Visible", "p" },
}},
{ class = "BallSocketConstraint", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "LimitsEnabled", "p" }, { "UpperAngle", "p" },
{ "TwistLimitsEnabled", "p" }, { "TwistLowerAngle", "p" }, { "TwistUpperAngle", "p" }, { "MaxFrictionTorque", "p" }, { "Enabled", "p" }, { "Visible", "p" },
}},
{ class = "RopeConstraint", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "Length", "p" }, { "Restitution", "p" },
{ "Thickness", "p" }, { "Color", "bc" }, { "WinchEnabled", "p" }, { "WinchTarget", "p" }, { "Enabled", "p" }, { "Visible", "p" },
}},
{ class = "SpringConstraint", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "Damping", "p" }, { "FreeLength", "p" },
{ "MaxForce", "p" }, { "Stiffness", "p" }, { "LimitsEnabled", "p" }, { "MinLength", "p" }, { "MaxLength", "p" },
{ "Coils", "p" }, { "Radius", "p" }, { "Thickness", "p" }, { "Enabled", "p" }, { "Visible", "p" },
}},
{ class = "AlignPosition", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "Mode", "en", "PositionAlignmentMode" },
{ "Position", "v3" }, { "MaxForce", "p" }, { "MaxVelocity", "p" }, { "Responsiveness", "p" },
{ "RigidityEnabled", "p" }, { "ApplyAtCenterOfMass", "p" }, { "Enabled", "p" },
}},
{ class = "AlignOrientation", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "Mode", "en", "OrientationAlignmentMode" },
{ "CFrame", "cf" }, { "MaxTorque", "p" }, { "MaxAngularVelocity", "p" }, { "Responsiveness", "p" },
{ "RigidityEnabled", "p" }, { "Enabled", "p" },
}},
{ class = "LinearVelocity", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "VelocityConstraintMode", "en", "VelocityConstraintMode" },
{ "VectorVelocity", "v3" }, { "LineVelocity", "p" }, { "LineDirection", "v3" }, { "PlaneVelocity", "v2" },
{ "MaxForce", "p" }, { "RelativeTo", "en", "ActuatorRelativeTo" }, { "Enabled", "p" },
}},
{ class = "VectorForce", props = {
{ "Attachment0", "ref", "Attachment" }, { "Force", "v3" }, { "ApplyAtCenterOfMass", "p" },
{ "RelativeTo", "en", "ActuatorRelativeTo" }, { "Enabled", "p" },
}},
-- NPC и персонажи
{ class = "Humanoid", props = {
{ "UseJumpPower", "p" }, { "MaxHealth", "p" }, { "Health", "p" }, { "WalkSpeed", "p" }, { "JumpPower", "p" },
{ "JumpHeight", "p" }, { "HipHeight", "p" }, { "DisplayName", "p" },
{ "DisplayDistanceType", "en", "HumanoidDisplayDistanceType" }, { "HealthDisplayType", "en", "HumanoidHealthDisplayType" },
{ "AutoRotate", "p" }, { "PlatformStand", "p" },
}},
{ class = "HumanoidDescription", props = {
{ "HeadColor", "c3" }, { "TorsoColor", "c3" }, { "LeftArmColor", "c3" }, { "RightArmColor", "c3" },
{ "LeftLegColor", "c3" }, { "RightLegColor", "c3" }, { "Shirt", "p" }, { "Pants", "p" }, { "GraphicTShirt", "p" },
{ "Face", "p" }, { "Head", "p" }, { "Torso", "p" }, { "LeftArm", "p" }, { "RightArm", "p" }, { "LeftLeg", "p" }, { "RightLeg", "p" },
{ "HatAccessory", "p" }, { "HairAccessory", "p" }, { "FaceAccessory", "p" }, { "NeckAccessory", "p" },
{ "ShouldersAccessory", "p" }, { "FrontAccessory", "p" }, { "BackAccessory", "p" }, { "WaistAccessory", "p" },
{ "HeightScale", "p" }, { "WidthScale", "p" }, { "DepthScale", "p" }, { "HeadScale", "p" }, { "BodyTypeScale", "p" }, { "ProportionScale", "p" },
}},
{ class = "Shirt", props = { { "ShirtTemplate", "p" }, { "Color3", "c3" } } },
{ class = "Pants", props = { { "PantsTemplate", "p" }, { "Color3", "c3" } } },
{ class = "ShirtGraphic", props = { { "Graphic", "p" }, { "Color3", "c3" } } },
{ class = "BodyColors", props = {
{ "HeadColor3", "c3" }, { "TorsoColor3", "c3" }, { "LeftArmColor3", "c3" },
{ "RightArmColor3", "c3" }, { "LeftLegColor3", "c3" }, { "RightLegColor3", "c3" },
}},
{ class = "Animation", props = { { "AnimationId", "p" } } },
{ class = "Accessory", props = { { "AttachmentPoint", "cf" }, { "AccessoryType", "en", "AccessoryType" } } },
-- Свет, огонь, дым, эффекты, постобработка
{ class = "Light", props = { { "Color", "c3" }, { "Brightness", "p" }, { "Range", "p" }, { "Enabled", "p" }, { "Shadows", "p" } } },
{ class = "SpotLight", props = { { "Angle", "p" }, { "Face", "en", "NormalId" } } },
{ class = "SurfaceLight", props = { { "Angle", "p" }, { "Face", "en", "NormalId" } } },
{ class = "Fire", props = { { "Color", "c3" }, { "SecondaryColor", "c3" }, { "Heat", "p" }, { "Size", "p" }, { "TimeScale", "p" }, { "Enabled", "p" } } },
{ class = "Smoke", props = { { "Color", "c3" }, { "Opacity", "p" }, { "RiseVelocity", "p" }, { "Size", "p" }, { "TimeScale", "p" }, { "Enabled", "p" } } },
{ class = "Sparkles", props = { { "SparkleColor", "c3" }, { "TimeScale", "p" }, { "Enabled", "p" } } },
{ class = "ForceField", props = { { "Visible", "p" } } },
{ class = "ParticleEmitter", props = {
{ "Enabled", "p" }, { "Texture", "p" }, { "Color", "cs" }, { "Size", "ns" }, { "Transparency", "ns" },
{ "Lifetime", "nr" }, { "Rate", "p" }, { "Speed", "nr" }, { "Rotation", "nr" }, { "RotSpeed", "nr" },
{ "SpreadAngle", "v2" }, { "Acceleration", "v3" }, { "Drag", "p" }, { "LightEmission", "p" },
{ "LightInfluence", "p" }, { "ZOffset", "p" }, { "LockedToPart", "p" }, { "TimeScale", "p" },
{ "EmissionDirection", "en", "NormalId" }, { "Orientation", "en", "ParticleOrientation" },
{ "VelocityInheritance", "p" }, { "Squash", "ns" }, { "Brightness", "p" },
{ "Shape", "en", "ParticleEmitterShape" }, { "ShapeInOut", "en", "ParticleEmitterShapeInOut" },
{ "ShapeStyle", "en", "ParticleEmitterShapeStyle" }, { "ShapePartial", "p" },
{ "FlipbookLayout", "en", "ParticleFlipbookLayout" }, { "FlipbookMode", "en", "ParticleFlipbookMode" },
{ "FlipbookFramerate", "nr" }, { "WindAffectsDrag", "p" },
}},
{ class = "Beam", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "Enabled", "p" },
{ "Color", "cs" }, { "Transparency", "ns" }, { "Texture", "p" }, { "TextureLength", "p" }, { "TextureSpeed", "p" },
{ "TextureMode", "en", "TextureMode" }, { "Width0", "p" }, { "Width1", "p" }, { "CurveSize0", "p" },
{ "CurveSize1", "p" }, { "Segments", "p" }, { "FaceCamera", "p" }, { "LightEmission", "p" }, { "LightInfluence", "p" }, { "ZOffset", "p" },
}},
{ class = "Trail", props = {
{ "Attachment0", "ref", "Attachment" }, { "Attachment1", "ref", "Attachment" }, { "Enabled", "p" },
{ "Color", "cs" }, { "Transparency", "ns" }, { "WidthScale", "ns" }, { "Texture", "p" }, { "TextureLength", "p" },
{ "TextureMode", "en", "TextureMode" }, { "Lifetime", "p" }, { "MaxLength", "p" }, { "MinLength", "p" },
{ "FaceCamera", "p" }, { "LightEmission", "p" }, { "LightInfluence", "p" },
}},
{ class = "BloomEffect", props = { { "Enabled", "p" }, { "Intensity", "p" }, { "Size", "p" }, { "Threshold", "p" } } },
{ class = "BlurEffect", props = { { "Enabled", "p" }, { "Size", "p" } } },
{ class = "SunRaysEffect", props = { { "Enabled", "p" }, { "Intensity", "p" }, { "Spread", "p" } } },
{ class = "DepthOfFieldEffect", props = { { "Enabled", "p" }, { "FarIntensity", "p" }, { "FocusDistance", "p" }, { "InFocusRadius", "p" }, { "NearIntensity", "p" } } },
{ class = "ColorCorrectionEffect", props = { { "Enabled", "p" }, { "Brightness", "p" }, { "Contrast", "p" }, { "Saturation", "p" }, { "TintColor", "c3" } } },
{ class = "Atmosphere", props = { { "Density", "p" }, { "Offset", "p" }, { "Color", "c3" }, { "Decay", "c3" }, { "Glare", "p" }, { "Haze", "p" } } },
{ class = "Sky", props = {
{ "SkyboxBk", "p" }, { "SkyboxDn", "p" }, { "SkyboxFt", "p" }, { "SkyboxLf", "p" }, { "SkyboxRt", "p" }, { "SkyboxUp", "p" },
{ "CelestialBodiesShown", "p" }, { "MoonAngularSize", "p" }, { "SunAngularSize", "p" }, { "StarCount", "p" },
}},
-- Звук
{ class = "Sound", props = {
{ "SoundId", "p" }, { "Volume", "p" }, { "Looped", "p" }, { "PlaybackSpeed", "p" }, { "RollOffMinDistance", "p" },
{ "RollOffMaxDistance", "p" }, { "RollOffMode", "en", "RollOffMode" }, { "PlayOnRemove", "p" }, { "SoundGroup", "ref", "SoundGroup" },
}},
{ class = "SoundGroup", props = { { "Volume", "p" } } },
{ class = "SoundEffect", props = { { "Enabled", "p" }, { "Priority", "p" } } },
{ class = "ReverbSoundEffect", props = { { "DecayTime", "p" }, { "Density", "p" }, { "Diffusion", "p" }, { "DryLevel", "p" }, { "WetLevel", "p" } } },
{ class = "EqualizerSoundEffect", props = { { "HighGain", "p" }, { "LowGain", "p" }, { "MidGain", "p" } } },
{ class = "EchoSoundEffect", props = { { "Delay", "p" }, { "DryLevel", "p" }, { "Feedback", "p" }, { "WetLevel", "p" } } },
{ class = "PitchShiftSoundEffect", props = { { "Octave", "p" } } },
{ class = "DistortionSoundEffect", props = { { "Level", "p" } } },
{ class = "CompressorSoundEffect", props = { { "Attack", "p" }, { "GainMakeup", "p" }, { "Release", "p" }, { "Threshold", "p" }, { "Ratio", "p" } } },
{ class = "ChorusSoundEffect", props = { { "Depth", "p" }, { "Mix", "p" }, { "Rate", "p" } } },
{ class = "FlangeSoundEffect", props = { { "Depth", "p" }, { "Mix", "p" }, { "Rate", "p" } } },
{ class = "TremoloSoundEffect", props = { { "Depth", "p" }, { "Duty", "p" }, { "Frequency", "p" } } },
-- Скрипты и все *Value
{ class = "BaseScript", props = { { "Enabled", "p" } } },
{ class = "Script", props = { { "RunContext", "en", "RunContext" } } },
{ class = "StringValue", props = { { "Value", "p" } } },
{ class = "IntValue", props = { { "Value", "p" } } },
{ class = "NumberValue", props = { { "Value", "p" } } },
{ class = "BoolValue", props = { { "Value", "p" } } },
{ class = "ObjectValue", props = { { "Value", "ref", "Instance" } } },
{ class = "Color3Value", props = { { "Value", "c3" } } },
{ class = "Vector3Value", props = { { "Value", "v3" } } },
{ class = "CFrameValue", props = { { "Value", "cf" } } },
{ class = "BrickColorValue", props = { { "Value", "bc" } } },
-- Полный UI (включая современные шрифты FontFace)
{ class = "GuiObject", props = {
{ "Position", "u2" }, { "Size", "u2" }, { "AnchorPoint", "v2" }, { "Rotation", "p" }, { "Visible", "p" },
{ "ZIndex", "p" }, { "LayoutOrder", "p" }, { "BackgroundColor3", "c3" }, { "BackgroundTransparency", "p" },
{ "BorderSizePixel", "p" }, { "BorderColor3", "c3" }, { "ClipsDescendants", "p" },
{ "AutomaticSize", "en", "AutomaticSize" }, { "SizeConstraint", "en", "SizeConstraint" }, { "Active", "p" },
}},
{ class = "ScrollingFrame", props = {
{ "CanvasSize", "u2" }, { "AutomaticCanvasSize", "en", "AutomaticSize" }, { "ScrollBarThickness", "p" },
{ "ScrollingDirection", "en", "ScrollingDirection" }, { "ScrollBarImageColor3", "c3" },
{ "ScrollBarImageTransparency", "p" }, { "CanvasPosition", "v2" },
}},
{ class = "CanvasGroup", props = { { "GroupColor3", "c3" }, { "GroupTransparency", "p" } } },
{ class = "ViewportFrame", props = {
{ "Ambient", "c3" }, { "LightColor", "c3" }, { "LightDirection", "v3" },
{ "ImageColor3", "c3" }, { "ImageTransparency", "p" },
}},
{ class = "TextLabel", props = {
{ "Text", "p" }, { "TextColor3", "c3" }, { "TextSize", "p" }, { "TextScaled", "p" }, { "TextWrapped", "p" },
{ "Font", "en", "Font" }, { "FontFace", "ff" },
{ "TextXAlignment", "en", "TextXAlignment" }, { "TextYAlignment", "en", "TextYAlignment" },
{ "RichText", "p" }, { "TextTransparency", "p" }, { "TextStrokeColor3", "c3" }, { "TextStrokeTransparency", "p" },
{ "TextTruncate", "en", "TextTruncate" }, { "LineHeight", "p" },
}},
{ class = "TextButton", props = {
{ "Text", "p" }, { "TextColor3", "c3" }, { "TextSize", "p" }, { "TextScaled", "p" }, { "TextWrapped", "p" },
{ "Font", "en", "Font" }, { "FontFace", "ff" },
{ "TextXAlignment", "en", "TextXAlignment" }, { "TextYAlignment", "en", "TextYAlignment" },
{ "RichText", "p" }, { "TextTransparency", "p" }, { "TextStrokeColor3", "c3" }, { "TextStrokeTransparency", "p" },
{ "TextTruncate", "en", "TextTruncate" }, { "LineHeight", "p" },
}},
{ class = "TextBox", props = {
{ "Text", "p" }, { "TextColor3", "c3" }, { "TextSize", "p" }, { "TextScaled", "p" }, { "TextWrapped", "p" },
{ "Font", "en", "Font" }, { "FontFace", "ff" },
{ "TextXAlignment", "en", "TextXAlignment" }, { "TextYAlignment", "en", "TextYAlignment" },
{ "RichText", "p" }, { "TextTransparency", "p" }, { "TextStrokeColor3", "c3" }, { "TextStrokeTransparency", "p" },
{ "PlaceholderText", "p" }, { "PlaceholderColor3", "c3" }, { "ClearTextOnFocus", "p" }, { "MultiLine", "p" },
}},
{ class = "ImageLabel", props = {
{ "Image", "p" }, { "ImageColor3", "c3" }, { "ImageTransparency", "p" },
{ "ScaleType", "en", "ScaleType" }, { "SliceCenter", "rect" }, { "SliceScale", "p" }, { "TileSize", "u2" },
}},
{ class = "ImageButton", props = {
{ "Image", "p" }, { "ImageColor3", "c3" }, { "ImageTransparency", "p" },
{ "ScaleType", "en", "ScaleType" }, { "SliceCenter", "rect" }, { "SliceScale", "p" }, { "TileSize", "u2" },
}},
{ class = "ScreenGui", props = {
{ "Enabled", "p" }, { "ResetOnSpawn", "p" }, { "DisplayOrder", "p" },
{ "IgnoreGuiInset", "p" }, { "ZIndexBehavior", "en", "ZIndexBehavior" },
}},
{ class = "BillboardGui", props = {
{ "Enabled", "p" }, { "Size", "u2" }, { "StudsOffset", "v3" }, { "ExtentsOffset", "v3" },
{ "AlwaysOnTop", "p" }, { "MaxDistance", "p" }, { "ClipsDescendants", "p" },
}},
{ class = "SurfaceGui", props = {
{ "Enabled", "p" }, { "Face", "en", "NormalId" }, { "CanvasSize", "v2" },
{ "SizingMode", "en", "SurfaceGuiSizingMode" }, { "PixelsPerStud", "p" }, { "AlwaysOnTop", "p" }, { "LightInfluence", "p" },
}},
{ class = "UICorner", props = { { "CornerRadius", "u1" } } },
{ class = "UIStroke", props = {
{ "Color", "c3" }, { "Thickness", "p" }, { "Transparency", "p" },
{ "ApplyStrokeMode", "en", "ApplyStrokeMode" }, { "LineJoinMode", "en", "LineJoinMode" }, { "Enabled", "p" },
}},
{ class = "UIGradient", props = { { "Color", "cs" }, { "Transparency", "ns" }, { "Offset", "v2" }, { "Rotation", "p" }, { "Enabled", "p" } } },
{ class = "UIAspectRatioConstraint", props = { { "AspectRatio", "p" }, { "AspectType", "en", "AspectType" }, { "DominantAxis", "en", "DominantAxis" } } },
{ class = "UISizeConstraint", props = { { "MaxSize", "v2" }, { "MinSize", "v2" } } },
{ class = "UITextSizeConstraint", props = { { "MaxTextSize", "p" }, { "MinTextSize", "p" } } },
{ class = "UIScale", props = { { "Scale", "p" } } },
{ class = "UIListLayout", props = {
{ "Padding", "u1" }, { "FillDirection", "en", "FillDirection" }, { "HorizontalAlignment", "en", "HorizontalAlignment" },
{ "VerticalAlignment", "en", "VerticalAlignment" }, { "SortOrder", "en", "SortOrder" }, { "Wraps", "p" },
}},
{ class = "UIGridLayout", props = {
{ "CellSize", "u2" }, { "CellPadding", "u2" }, { "FillDirection", "en", "FillDirection" },
{ "HorizontalAlignment", "en", "HorizontalAlignment" }, { "VerticalAlignment", "en", "VerticalAlignment" }, { "SortOrder", "en", "SortOrder" },
}},
{ class = "UIPadding", props = { { "PaddingTop", "u1" }, { "PaddingBottom", "u1" }, { "PaddingLeft", "u1" }, { "PaddingRight", "u1" } } },
}
local SPECS_BY_CLASS, DEFAULT_TEMPLATES = {}, {}
local function getSpecsForInstance(inst)
local cls = inst.ClassName
local cached = SPECS_BY_CLASS[cls]
if cached then return cached end
local list = {}
for _, spec in ipairs(CLASS_SPECS) do
if inst:IsA(spec.class) then table.insert(list, spec) end
end
SPECS_BY_CLASS[cls] = list
return list
end
local function getDefaultTemplate(className)
local cached = DEFAULT_TEMPLATES[className]
if cached == false then return nil end
if cached then return cached end
local ok, tpl = pcall(Instance.new, className)
if ok and tpl then
pcall(function() tpl.Archivable = false end)
DEFAULT_TEMPLATES[className] = tpl
return tpl
end
DEFAULT_TEMPLATES[className] = false
return nil
end
local function valuesEqual(a, b)
if type(a) == "number" and type(b) == "number" then
return math.abs(a - b) < 1e-5
end
local ok, eq = pcall(function() return a == b end)
return ok and eq == true
end
local ALLOWED_CLASSES = {
Part = true, MeshPart = true, WedgePart = true, CornerWedgePart = true, TrussPart = true,
SpawnLocation = true, Seat = true, VehicleSeat = true, SurfaceAppearance = true, MaterialVariant = true, Clouds = true,
Model = true, Folder = true, Configuration = true, Tool = true, Attachment = true, SpecialMesh = true,
Decal = true, Texture = true, Highlight = true, ClickDetector = true, ProximityPrompt = true, PathfindingModifier = true,
Team = true, TextChatCommand = true, TextChannel = true,
WeldConstraint = true, Weld = true, Motor6D = true, NoCollisionConstraint = true,
HingeConstraint = true, PrismaticConstraint = true, BallSocketConstraint = true, RopeConstraint = true,
SpringConstraint = true, AlignPosition = true, AlignOrientation = true, LinearVelocity = true, VectorForce = true,
Humanoid = true, HumanoidDescription = true, Animator = true,
Shirt = true, Pants = true, ShirtGraphic = true, BodyColors = true, Animation = true, Accessory = true,
PointLight = true, SpotLight = true, SurfaceLight = true, Fire = true, Smoke = true, Sparkles = true, ForceField = true,
ParticleEmitter = true, Beam = true, Trail = true,
Sky = true, Atmosphere = true, BloomEffect = true, BlurEffect = true, SunRaysEffect = true, DepthOfFieldEffect = true, ColorCorrectionEffect = true,
Sound = true, SoundGroup = true, ReverbSoundEffect = true, EqualizerSoundEffect = true, EchoSoundEffect = true,
PitchShiftSoundEffect = true, DistortionSoundEffect = true, CompressorSoundEffect = true, ChorusSoundEffect = true, FlangeSoundEffect = true, TremoloSoundEffect = true,
Script = true, LocalScript = true, ModuleScript = true,
RemoteEvent = true, RemoteFunction = true, UnreliableRemoteEvent = true, BindableEvent = true, BindableFunction = true,
StringValue = true, IntValue = true, NumberValue = true, BoolValue = true,
ObjectValue = true, Color3Value = true, Vector3Value = true, CFrameValue = true, BrickColorValue = true,
ScreenGui = true, BillboardGui = true, SurfaceGui = true, Frame = true, ScrollingFrame = true, CanvasGroup = true, ViewportFrame = true,
TextLabel = true, TextButton = true, TextBox = true, ImageLabel = true, ImageButton = true,
UICorner = true, UIStroke = true, UIGradient = true, UIAspectRatioConstraint = true, UISizeConstraint = true, UITextSizeConstraint = true,
UIScale = true, UIListLayout = true, UIGridLayout = true, UIPadding = true,
}
local SYNC_PROPS = { Parent = true, Name = true, Position = true, Orientation = true, BrickColor = true, Source = true, Disabled = true }
for _, spec in ipairs(CLASS_SPECS) do
for _, p in ipairs(spec.props) do SYNC_PROPS[p[1]] = true end
end
local LIGHTING_SPEC = {
{ "ClockTime", "p" }, { "Brightness", "p" }, { "Ambient", "c3" }, { "OutdoorAmbient", "c3" },
{ "FogStart", "p" }, { "FogEnd", "p" }, { "FogColor", "c3" }, { "GlobalShadows", "p" },
{ "ExposureCompensation", "p" }, { "GeographicLatitude", "p" }, { "ShadowSoftness", "p" },
{ "EnvironmentDiffuseScale", "p" }, { "EnvironmentSpecularScale", "p" },
{ "ColorShift_Top", "c3" }, { "ColorShift_Bottom", "c3" }, { "Technology", "en", "Technology" },
}
local LIGHTING_WATCH = { TimeOfDay = true }
for _, p in ipairs(LIGHTING_SPEC) do LIGHTING_WATCH[p[1]] = true end
local STARTER_PLAYER_SPEC = {
{ "CharacterUseJumpPower", "p" }, { "CharacterWalkSpeed", "p" }, { "CharacterJumpPower", "p" },
{ "CharacterJumpHeight", "p" }, { "CharacterMaxSlopeAngle", "p" },
{ "CameraMaxZoomDistance", "p" }, { "CameraMinZoomDistance", "p" },
{ "CameraMode", "en", "CameraMode" }, { "DevCameraOcclusionMode", "en", "DevCameraOcclusionMode" },
{ "AutoJumpEnabled", "p" }, { "EnableMouseLockOption", "p" }, { "LoadCharacterAppearance", "p" },
}
local STARTER_PLAYER_WATCH = {}
for _, p in ipairs(STARTER_PLAYER_SPEC) do STARTER_PLAYER_WATCH[p[1]] = true end
local WORKSPACE_SVC_SPEC = {
{ "Gravity", "p" }, { "FallenPartsDestroyHeight", "p" }, { "AirDensity", "p" }, { "GlobalWind", "v3" },
}
local WORKSPACE_SVC_WATCH = {}
for _, p in ipairs(WORKSPACE_SVC_SPEC) do WORKSPACE_SVC_WATCH[p[1]] = true end
local TERRAIN_SVC_SPEC = {
{ "WaterColor", "c3" }, { "WaterReflectance", "p" }, { "WaterTransparency", "p" },
{ "WaterWaveSize", "p" }, { "WaterWaveSpeed", "p" }, { "Decoration", "p" },
}
local TERRAIN_SVC_WATCH = {}
for _, p in ipairs(TERRAIN_SVC_SPEC) do TERRAIN_SVC_WATCH[p[1]] = true end
-- ===================== СОСТОЯНИЕ И НАСТРОЙКИ =====================
local THEME = {
Bg = Color3.fromRGB(18, 19, 24), Surface = Color3.fromRGB(26, 28, 36), SurfaceHover = Color3.fromRGB(34, 37, 48),
BubbleMine = Color3.fromRGB(30, 54, 92), BubbleMineStroke = Color3.fromRGB(52, 92, 152),
Input = Color3.fromRGB(21, 22, 29), Border = Color3.fromRGB(43, 47, 61), Accent = Color3.fromRGB(59, 130, 246),
Danger = Color3.fromRGB(220, 62, 68), Success = Color3.fromRGB(34, 197, 94), Warning = Color3.fromRGB(245, 158, 11),
Text = Color3.fromRGB(241, 245, 249), TextMuted = Color3.fromRGB(142, 152, 172),
}
local MAX_CHUNK_ITEMS, MAX_CHUNK_BYTES, MAX_RETRY_BATCH = 400, 700000, 1000
local defaultNick = "Dev_" .. tostring(math.random(100, 999))
local localUid = getLocalUserId()
if localUid > 0 then pcall(function() defaultNick = Players:GetNameFromUserIdAsync(localUid) end) end
local savedNick = loadSetting("MiniTC_Nick", defaultNick)
local cIdx = ((tonumber(loadSetting("MiniTC_ColorIdx", math.random(1, #PEER_PALETTE))) or 1) - 1) % #PEER_PALETTE + 1
local S = {
clientId = HttpService:GenerateGUID(false),
userId = localUid,
colorIdx = cIdx,
myColor = PEER_PALETTE[cIdx],
serverUrl = loadSetting("MiniTC_Url", "http://127.0.0.1:34872"),
showCursors = loadSetting("MiniTC_Cursors", true) ~= false,
scriptLock = loadSetting("MiniTC_Lock", true) ~= false,
syncServices = loadSetting("MiniTC_Lighting", true) ~= false,
syncTerrain = loadSetting("MiniTC_Terrain", true) ~= false,
teamTest = loadSetting("MiniTC_TeamTest", true) ~= false,
connected = false, isConnecting = false, awaitingConflict = false, pendingConnect = nil,
isBusy = false, remoteApplyDepth = 0, serviceGuardUntil = 0,
serverEpoch = 0, lastSeq = 0, lastChatSeq = 0, lastTodosSeq = 0, lastHistorySeq = 0,
unreadChat = 0, currentTab = "sync", archiveSubTab = "backups",
teamTestActive = false, testCount = 0, spectatingPeerId = nil, consecutiveErrors = 0,
terrainScanAt = 0, lastTerrainBounds = "", lastCamHash = "", renderBound = false,
idToInstance = {}, instanceConns = {}, rootConnections = {},
remoteGuard = setmetatable({}, { __mode = "k" }),
lastTagsCache = setmetatable({}, { __mode = "k" }),
pendingUpserts = {}, pendingDeletes = {}, pendingLinks = {}, failedBatch = {},
terrainChunkHashes = {}, meshCache = {},
pendingLighting = false, pendingStarterPlayer = false, pendingTerrainSvc = false, pendingWorkspace = false,
remoteLocks = {}, latestPeersById = {}, avatarIdCache = {},
lastTeamFp = "", chatMsgCount = 0,
visualsFolder = nil, peerVisuals = {},
}
if S.userId == 0 and savedNick ~= "" then
task.spawn(function()
local ok, uid = pcall(function() return Players:GetUserIdFromNameAsync(savedNick) end)
if ok and type(uid) == "number" and uid > 0 then S.userId = uid end
end)
end
local UI = {}
local httpRequest, refreshBackupsUI, pullSnapshot, uploadFullScene, flushPendingChanges, renderTodosList, renderHistoryList, setSpectatingPeer, disconnectAll, finishConnect
-- ===================== АВТОЗАЩИТА СОХРАНЕНИЯ И ПУБЛИКАЦИИ =====================
local function beginHistoryRecording(tag)
local ok, recId = pcall(function()
return ChangeHistoryService:TryBeginRecording("MiniTC_" .. tostring(tag), PLUGIN_NAME .. ": " .. tostring(tag))
end)
return (ok and recId) and recId or nil
end
local function finishHistoryRecording(recId, fallbackName, commit)
if recId then
local op = (commit == false) and Enum.FinishRecordingOperation.Cancel or Enum.FinishRecordingOperation.Commit
pcall(function() ChangeHistoryService:FinishRecording(recId, op) end)
elseif commit ~= false and fallbackName then
pcall(function() ChangeHistoryService:SetWaypoint("MiniTC_" .. tostring(fallbackName)) end)
end
end
local function isTempPluginObject(inst)
if not inst then return true end
local n = inst.Name
if n == "_MiniTC_Visuals" or n == "_MiniTC_TeamTest" then return true end
local cam = workspace.CurrentCamera
if cam and (inst == cam or inst:IsDescendantOf(cam)) then return true end
local tt = workspace:FindFirstChild("_MiniTC_TeamTest")
if tt and inst:IsDescendantOf(tt) then return true end
return false
end
local function isProtectedSystemObject(inst)
if not inst then return true end
if TextChatService and inst:IsDescendantOf(TextChatService) then
if inst.Parent == TextChatService and TEXTCHAT_BUILTINS[inst.Name] then return true end
if inst:IsA("TextChannel") and (inst.Name == "RBXGeneral" or inst.Name == "RBXSystem") then return true end
if inst:IsA("TextChatCommand") and string.sub(inst.Name, 1, 3) == "RBX" then return true end
end
return false
end
local function ensureArchivable(inst)
if not inst or isTempPluginObject(inst) then return false end
if not inst.Archivable then
S.remoteGuard[inst] = os.clock() + 0.25
return pcall(function() inst.Archivable = true end)
end
return false
end
local function sweepSceneArchivable(sliceBudget)
local fixed, tSlice, budget = 0, os.clock(), sliceBudget or 0.008
if ensureArchivable(Terrain) then fixed += 1 end
for _, root in ipairs(ROOT_LIST) do
if ensureArchivable(root) then fixed += 1 end
for _, desc in ipairs(root:GetDescendants()) do
if not desc.Archivable and not isTempPluginObject(desc) then
if pcall(function() desc.Archivable = true end) then fixed += 1 end
end
if os.clock() - tSlice > budget then task.wait(); tSlice = os.clock() end
end
end
return fixed
end
local function autoFixSceneArchivable()
if S.isBusy then return end
local toFix, tSlice = {}, os.clock()
if not Terrain.Archivable then table.insert(toFix, Terrain) end
for _, root in ipairs(ROOT_LIST) do
if not root.Archivable then table.insert(toFix, root) end
for _, desc in ipairs(root:GetDescendants()) do
if not desc.Archivable and not isTempPluginObject(desc) then
table.insert(toFix, desc)
end
if os.clock() - tSlice > 0.005 then task.wait(); tSlice = os.clock() end
end
end
if #toFix == 0 or S.isBusy then return end
local recId = beginHistoryRecording("AutoArchivable")
local fixed = 0
pcall(function()
for _, inst in ipairs(toFix) do
if inst and inst.Parent and not inst.Archivable and not isTempPluginObject(inst) then
S.remoteGuard[inst] = os.clock() + 0.25
if pcall(function() inst.Archivable = true end) then fixed += 1 end
end
end
end)
finishHistoryRecording(recId, "AutoArchivable", fixed > 0)
end
local function isDefaultBaseplatePart(d)
if d.Parent == workspace and (d.Name == "Baseplate" or d.Name == "SpawnLocation") then return true end
if (d:IsA("Texture") or d:IsA("Decal")) and d.Parent and d.Parent.Parent == workspace
and (d.Parent.Name == "Baseplate" or d.Parent.Name == "SpawnLocation") then
return true
end
return false
end
local function inspectSceneState(serverItems)
local serverRealCount = 0
if type(serverItems) == "table" then
for _, it in ipairs(serverItems) do
if it.id and string.sub(it.id, 1, 8) ~= "SERVICE:" then serverRealCount += 1 end
end
end
local ext = Terrain.MaxExtents
local hasTerrain = (ext.Min.X < ext.Max.X and ext.Min.Y < ext.Max.Y and ext.Min.Z < ext.Max.Z)
local customCount, totalLocal, tSlice = 0, 0, os.clock()
for _, root in ipairs(ROOT_LIST) do
if root ~= Lighting then
for _, d in ipairs(root:GetDescendants()) do
if not isTempPluginObject(d) and not isProtectedSystemObject(d) and d ~= Terrain and not ROOT_KEY_MAP[d] then
if ALLOWED_CLASSES[d.ClassName] or d:IsA("BasePart") then
totalLocal += 1
if not isDefaultBaseplatePart(d) then customCount += 1 end
end
end
if os.clock() - tSlice > 0.01 then task.wait(); tSlice = os.clock() end
end
end
end
return {
customCount = customCount,
totalLocal = totalLocal,
hasTerrain = hasTerrain,
serverRealCount = serverRealCount,
hasLocalMap = (customCount > 0 or hasTerrain),
}
end
-- ===================== ПОСТРОЕНИЕ UI =====================
local function addCorner(p, r) local c = Instance.new("UICorner"); c.CornerRadius = UDim.new(0, r or 7); c.Parent = p; return c end
local function addStroke(p, col, th) local s = Instance.new("UIStroke"); s.Color = col or THEME.Border; s.Thickness = th or 1; s.ApplyStrokeMode = Enum.ApplyStrokeMode.Border; s.Parent = p; return s end
local function styleBox(box, isMono)
box.BackgroundColor3 = THEME.Input; box.TextColor3 = THEME.Text; box.PlaceholderColor3 = Color3.fromRGB(95, 103, 122)
box.Font = isMono and Enum.Font.Code or Enum.Font.Gotham; box.TextSize = 12; box.TextXAlignment = Enum.TextXAlignment.Left; box.ClearTextOnFocus = false
addCorner(box, 7); local st = addStroke(box, THEME.Border, 1)
local pd = Instance.new("UIPadding"); pd.PaddingLeft = UDim.new(0, 9); pd.PaddingRight = UDim.new(0, 9); pd.Parent = box
box.Focused:Connect(function() st.Color = THEME.Accent end); box.FocusLost:Connect(function() st.Color = THEME.Border end)
end
local function createAvatarWidget(parent, sizePx, userId, name, col)
local holder = Instance.new("Frame"); holder.Size = UDim2.new(0, sizePx, 0, sizePx); holder.BackgroundColor3 = col
holder.BorderSizePixel = 0; holder.ClipsDescendants = true; holder.Parent = parent; addCorner(holder, sizePx); addStroke(holder, col, 1.2)
local init = Instance.new("TextLabel"); init.Size = UDim2.fromScale(1, 1); init.BackgroundTransparency = 1
init.Font = Enum.Font.GothamBold; init.TextSize = math.max(11, math.floor(sizePx * 0.45)); init.TextColor3 = Color3.new(1, 1, 1)
init.Text = string.upper(string.sub(name or "D", 1, 1)); init.Parent = holder
local img = Instance.new("ImageLabel"); img.Size = UDim2.fromScale(1, 1); img.BackgroundTransparency = 1; img.ScaleType = Enum.ScaleType.Crop
img.Image = ""; img.Parent = holder; addCorner(img, sizePx)
local uid = tonumber(userId) or 0
if uid > 0 then img.Image = getAvatarThumb(uid)
elseif name and name ~= "" then
local cached = S.avatarIdCache[name]
if cached ~= nil then if cached > 0 then img.Image = getAvatarThumb(cached) end
else
task.spawn(function()
local ok, r = pcall(function() return Players:GetUserIdFromNameAsync(name) end)
local fid = (ok and type(r) == "number" and r > 0) and r or 0
S.avatarIdCache[name] = fid
if fid > 0 and img and img.Parent then img.Image = getAvatarThumb(fid) end
end)
end
end
return holder
end
local function setStatus(text, dotColor)
UI.statusText.Text = text
if dotColor then UI.statusDot.BackgroundColor3 = dotColor end
end
local function setLockBanner(text, isWarn)
if not text or text == "" then UI.infoBanner.Visible = false; return end
UI.infoBanner.Visible = true; UI.infoLabel.Text = text
UI.infoBanner.BackgroundColor3 = isWarn and Color3.fromRGB(52, 26, 30) or Color3.fromRGB(24, 38, 56)
UI.infoStroke.Color = isWarn and THEME.Danger or THEME.Accent
UI.infoLabel.TextColor3 = isWarn and Color3.fromRGB(252, 165, 165) or Color3.fromRGB(165, 205, 255)
end
local function refreshTeamTestCard()
if S.teamTestActive or S.testCount > 0 then
UI.teamTestStroke.Color = THEME.Success; UI.ttSub.TextColor3 = THEME.Success
UI.ttSub.Text = S.testCount > 0 and ("В игре: " .. tostring(S.testCount) .. " · жмите F5") or "Активен · нажмите Play (F5)"
UI.teamTestBtn.Text = "Стоп"; UI.teamTestBtn.BackgroundColor3 = THEME.SurfaceHover
else
UI.teamTestStroke.Color = THEME.Border; UI.ttSub.TextColor3 = THEME.TextMuted
UI.ttSub.Text = "Аватары друзей в Play (F5)"; UI.teamTestBtn.Text = "Позвать"; UI.teamTestBtn.BackgroundColor3 = Color3.fromRGB(30, 128, 74)
end
end
local function refreshPagesTopOffset()
local active = S.spectatingPeerId ~= nil
UI.specBar.Visible = active
local topY = active and 120 or 86
local hOff = active and -130 or -96
for _, p in ipairs({ UI.pageSync, UI.pageChat, UI.pageTeam, UI.pageTodo, UI.pageArch }) do
p.Position = UDim2.new(0, 12, 0, topY)
p.Size = UDim2.new(1, -24, 1, hOff)
end
end
local function styleChoiceCard(hasLocalMap)
if hasLocalMap then
UI.conflictUploadBtn.BackgroundColor3 = THEME.Accent; UI.conflictUploadBtn.TextColor3 = Color3.new(1, 1, 1); UI.conflictUploadStroke.Color = THEME.Accent
UI.conflictDownloadBtn.BackgroundColor3 = THEME.SurfaceHover; UI.conflictDownloadBtn.TextColor3 = THEME.Text; UI.conflictDownloadStroke.Color = THEME.Border
else
UI.conflictDownloadBtn.BackgroundColor3 = THEME.Accent; UI.conflictDownloadBtn.TextColor3 = Color3.new(1, 1, 1); UI.conflictDownloadStroke.Color = THEME.Accent
UI.conflictUploadBtn.BackgroundColor3 = THEME.SurfaceHover; UI.conflictUploadBtn.TextColor3 = THEME.Text; UI.conflictUploadStroke.Color = THEME.Border
end
end
local function buildUI()
local toolbar = plugin:CreateToolbar(PLUGIN_NAME)
local toggleBtn = toolbar:CreateButton(PLUGIN_NAME, "Открыть " .. PLUGIN_NAME .. " " .. PLUGIN_VERSION, PLUGIN_ICON)
local widget = plugin:CreateDockWidgetPluginGui("MiniTeamCreateWidgetV10", DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, false, false, 340, 500, 305, 360))
widget.Title = PLUGIN_NAME
toggleBtn.Click:Connect(function() widget.Enabled = not widget.Enabled end)
local root = Instance.new("Frame"); root.Size = UDim2.fromScale(1, 1); root.BackgroundColor3 = THEME.Bg; root.BorderSizePixel = 0; root.Parent = widget
-- Шапка
local header = Instance.new("Frame"); header.Size = UDim2.new(1, -24, 0, 28); header.Position = UDim2.new(0, 12, 0, 10); header.BackgroundTransparency = 1; header.Parent = root
UI.statusDot = Instance.new("Frame"); UI.statusDot.Size = UDim2.new(0, 8, 0, 8); UI.statusDot.Position = UDim2.new(0, 0, 0.5, -4); UI.statusDot.BackgroundColor3 = THEME.TextMuted; UI.statusDot.BorderSizePixel = 0; UI.statusDot.Parent = header; addCorner(UI.statusDot, 4)
UI.statusText = Instance.new("TextLabel"); UI.statusText.Size = UDim2.new(1, -72, 1, 0); UI.statusText.Position = UDim2.new(0, 14, 0, 0); UI.statusText.BackgroundTransparency = 1; UI.statusText.Font = Enum.Font.GothamMedium; UI.statusText.TextSize = 12; UI.statusText.TextColor3 = THEME.Text; UI.statusText.TextXAlignment = Enum.TextXAlignment.Left; UI.statusText.TextTruncate = Enum.TextTruncate.AtEnd; UI.statusText.Text = "Отключено"; UI.statusText.Parent = header
UI.pingBadge = Instance.new("TextLabel"); UI.pingBadge.Size = UDim2.new(0, 54, 0, 22); UI.pingBadge.Position = UDim2.new(1, -54, 0.5, -11); UI.pingBadge.BackgroundColor3 = THEME.Surface; UI.pingBadge.Font = Enum.Font.Code; UI.pingBadge.TextSize = 11; UI.pingBadge.TextColor3 = THEME.TextMuted; UI.pingBadge.Text = PLUGIN_VERSION; UI.pingBadge.Parent = header; addCorner(UI.pingBadge, 5); addStroke(UI.pingBadge, THEME.Border, 1)
-- Вкладки
local tabTrack = Instance.new("Frame"); tabTrack.Size = UDim2.new(1, -24, 0, 32); tabTrack.Position = UDim2.new(0, 12, 0, 44); tabTrack.BackgroundColor3 = THEME.Surface; tabTrack.BorderSizePixel = 0; tabTrack.Parent = root; addCorner(tabTrack, 8); addStroke(tabTrack, THEME.Border, 1)
local tp = Instance.new("UIPadding"); tp.PaddingTop = UDim.new(0, 3); tp.PaddingBottom = UDim.new(0, 3); tp.PaddingLeft = UDim.new(0, 3); tp.PaddingRight = UDim.new(0, 3); tp.Parent = tabTrack
local function makeTab(idx, title)
local b = Instance.new("TextButton"); b.Size = UDim2.new(0.2, 0, 1, 0); b.Position = UDim2.new((idx - 1) * 0.2, 0, 0, 0); b.BackgroundTransparency = 1; b.BackgroundColor3 = THEME.Accent; b.BorderSizePixel = 0; b.AutoButtonColor = false; b.Font = Enum.Font.GothamMedium; b.TextSize = 11; b.TextColor3 = THEME.TextMuted; b.Text = title; b.Parent = tabTrack; addCorner(b, 6); return b
end
UI.tabSync, UI.tabChat, UI.tabTeam, UI.tabTodo, UI.tabArch = makeTab(1, "Обзор"), makeTab(2, "Чат"), makeTab(3, "Люди"), makeTab(4, "Дела"), makeTab(5, "Архив")
-- Полоска активной слежки
UI.specBar = Instance.new("Frame"); UI.specBar.Size = UDim2.new(1, -24, 0, 28); UI.specBar.Position = UDim2.new(0, 12, 0, 84); UI.specBar.BackgroundColor3 = Color3.fromRGB(24, 42, 72); UI.specBar.Visible = false; UI.specBar.Parent = root; addCorner(UI.specBar, 7); addStroke(UI.specBar, THEME.Accent, 1)
UI.specLabel = Instance.new("TextLabel"); UI.specLabel.Size = UDim2.new(1, -66, 1, 0); UI.specLabel.Position = UDim2.new(0, 10, 0, 0); UI.specLabel.BackgroundTransparency = 1; UI.specLabel.Font = Enum.Font.GothamBold; UI.specLabel.TextSize = 11; UI.specLabel.TextColor3 = Color3.fromRGB(185, 215, 255); UI.specLabel.TextXAlignment = Enum.TextXAlignment.Left; UI.specLabel.TextTruncate = Enum.TextTruncate.AtEnd; UI.specLabel.Text = "Слежка"; UI.specLabel.Parent = UI.specBar
local specStopBtn = Instance.new("TextButton"); specStopBtn.Size = UDim2.new(0, 50, 0, 20); specStopBtn.Position = UDim2.new(1, -55, 0.5, -10); specStopBtn.BackgroundColor3 = THEME.Danger; specStopBtn.TextColor3 = Color3.new(1, 1, 1); specStopBtn.Font = Enum.Font.GothamBold; specStopBtn.TextSize = 10; specStopBtn.Text = "Стоп"; specStopBtn.Parent = UI.specBar; addCorner(specStopBtn, 5)
specStopBtn.MouseButton1Click:Connect(function() if setSpectatingPeer then setSpectatingPeer(nil) end end)
local function makePage(scr)
local p = Instance.new(scr and "ScrollingFrame" or "Frame"); p.Size = UDim2.new(1, -24, 1, -96); p.Position = UDim2.new(0, 12, 0, 86); p.BackgroundTransparency = 1; p.BorderSizePixel = 0; p.Visible = false
if scr then p.ScrollBarThickness = 3; p.ScrollBarImageColor3 = THEME.Border; p.AutomaticCanvasSize = Enum.AutomaticSize.Y; p.CanvasSize = UDim2.new(0, 0, 0, 0) end
p.Parent = root; return p
end
UI.pageSync, UI.pageChat, UI.pageTeam, UI.pageTodo, UI.pageArch = makePage(true), makePage(false), makePage(false), makePage(false), makePage(false)
local sp = Instance.new("UIPadding"); sp.PaddingTop = UDim.new(0, 1); sp.PaddingBottom = UDim.new(0, 10); sp.PaddingLeft = UDim.new(0, 1); sp.PaddingRight = UDim.new(0, 1); sp.Parent = UI.pageSync
local function styleTab(btn, act) btn.BackgroundTransparency = act and 0 or 1; btn.TextColor3 = act and Color3.new(1, 1, 1) or THEME.TextMuted; btn.Font = act and Enum.Font.GothamBold or Enum.Font.GothamMedium end
local function switchTab(name)
S.currentTab = name
UI.pageSync.Visible = (name == "sync"); UI.pageChat.Visible = (name == "chat"); UI.pageTeam.Visible = (name == "team"); UI.pageTodo.Visible = (name == "todo"); UI.pageArch.Visible = (name == "arch")
styleTab(UI.tabSync, name == "sync"); styleTab(UI.tabChat, name == "chat"); styleTab(UI.tabTeam, name == "team"); styleTab(UI.tabTodo, name == "todo"); styleTab(UI.tabArch, name == "arch")
if name == "chat" then S.unreadChat = 0; UI.tabChat.Text = "Чат"
elseif name == "arch" and S.archiveSubTab == "backups" and S.connected and refreshBackupsUI then task.spawn(refreshBackupsUI) end
end
UI.switchTab = switchTab
UI.tabSync.MouseButton1Click:Connect(function() switchTab("sync") end)
UI.tabChat.MouseButton1Click:Connect(function() switchTab("chat") end)
UI.tabTeam.MouseButton1Click:Connect(function() switchTab("team") end)
UI.tabTodo.MouseButton1Click:Connect(function() switchTab("todo") end)
UI.tabArch.MouseButton1Click:Connect(function() switchTab("arch") end)
-- Вкладка 1: Обзор
local sl = Instance.new("UIListLayout"); sl.Padding = UDim.new(0, 9); sl.SortOrder = Enum.SortOrder.LayoutOrder; sl.Parent = UI.pageSync
local urlWrap = Instance.new("Frame"); urlWrap.Size = UDim2.new(1, 0, 0, 46); urlWrap.BackgroundTransparency = 1; urlWrap.LayoutOrder = 1; urlWrap.Parent = UI.pageSync
local urlLbl = Instance.new("TextLabel"); urlLbl.Size = UDim2.new(1, 0, 0, 15); urlLbl.BackgroundTransparency = 1; urlLbl.Font = Enum.Font.GothamMedium; urlLbl.TextSize = 11; urlLbl.TextColor3 = THEME.TextMuted; urlLbl.TextXAlignment = Enum.TextXAlignment.Left; urlLbl.Text = "Адрес сервера"; urlLbl.Parent = urlWrap
UI.urlBox = Instance.new("TextBox"); UI.urlBox.Size = UDim2.new(1, 0, 0, 29); UI.urlBox.Position = UDim2.new(0, 0, 0, 17); UI.urlBox.Text = S.serverUrl; UI.urlBox.PlaceholderText = "http://IP:34872"; UI.urlBox.Parent = urlWrap; styleBox(UI.urlBox, true)
local nickWrap = Instance.new("Frame"); nickWrap.Size = UDim2.new(1, 0, 0, 46); nickWrap.BackgroundTransparency = 1; nickWrap.LayoutOrder = 2; nickWrap.Parent = UI.pageSync
local nickLbl = Instance.new("TextLabel"); nickLbl.Size = UDim2.new(1, 0, 0, 15); nickLbl.BackgroundTransparency = 1; nickLbl.Font = Enum.Font.GothamMedium; nickLbl.TextSize = 11; nickLbl.TextColor3 = THEME.TextMuted; nickLbl.TextXAlignment = Enum.TextXAlignment.Left; nickLbl.Text = "Ник и цвет"; nickLbl.Parent = nickWrap
UI.nickBox = Instance.new("TextBox"); UI.nickBox.Size = UDim2.new(1, -36, 0, 29); UI.nickBox.Position = UDim2.new(0, 0, 0, 17); UI.nickBox.Text = savedNick; UI.nickBox.PlaceholderText = "Ваш ник"; UI.nickBox.Parent = nickWrap; styleBox(UI.nickBox, false)
local cBtn = Instance.new("TextButton"); cBtn.Size = UDim2.new(0, 29, 0, 29); cBtn.Position = UDim2.new(1, -29, 0, 17); cBtn.BackgroundColor3 = Color3.new(S.myColor[1], S.myColor[2], S.myColor[3]); cBtn.Text = ""; cBtn.AutoButtonColor = false; cBtn.Parent = nickWrap; addCorner(cBtn, 7); addStroke(cBtn, THEME.Border, 1)
cBtn.MouseButton1Click:Connect(function()
S.colorIdx = (S.colorIdx % #PEER_PALETTE) + 1; S.myColor = PEER_PALETTE[S.colorIdx]
cBtn.BackgroundColor3 = Color3.new(S.myColor[1], S.myColor[2], S.myColor[3]); saveSetting("MiniTC_ColorIdx", S.colorIdx)
end)
UI.connectBtn = Instance.new("TextButton"); UI.connectBtn.Size = UDim2.new(1, 0, 0, 34); UI.connectBtn.BackgroundColor3 = THEME.Accent; UI.connectBtn.TextColor3 = Color3.new(1, 1, 1); UI.connectBtn.Font = Enum.Font.GothamBold; UI.connectBtn.TextSize = 13; UI.connectBtn.Text = "Подключиться"; UI.connectBtn.LayoutOrder = 3; UI.connectBtn.Parent = UI.pageSync; addCorner(UI.connectBtn, 8)
-- Карточка выбора карты при подключении
UI.conflictCard = Instance.new("Frame"); UI.conflictCard.Size = UDim2.new(1, 0, 0, 126); UI.conflictCard.BackgroundColor3 = Color3.fromRGB(36, 32, 22); UI.conflictCard.Visible = false; UI.conflictCard.LayoutOrder = 4; UI.conflictCard.Parent = UI.pageSync; addCorner(UI.conflictCard, 8); addStroke(UI.conflictCard, THEME.Warning, 1.4)
UI.conflictTitle = Instance.new("TextLabel"); UI.conflictTitle.Size = UDim2.new(1, -20, 0, 16); UI.conflictTitle.Position = UDim2.new(0, 10, 0, 8); UI.conflictTitle.BackgroundTransparency = 1; UI.conflictTitle.Font = Enum.Font.GothamBold; UI.conflictTitle.TextSize = 12; UI.conflictTitle.TextColor3 = Color3.fromRGB(253, 224, 140); UI.conflictTitle.TextXAlignment = Enum.TextXAlignment.Left; UI.conflictTitle.Text = "Выберите карту"; UI.conflictTitle.Parent = UI.conflictCard
UI.conflictDesc = Instance.new("TextLabel"); UI.conflictDesc.Size = UDim2.new(1, -20, 0, 28); UI.conflictDesc.Position = UDim2.new(0, 10, 0, 26); UI.conflictDesc.BackgroundTransparency = 1; UI.conflictDesc.Font = Enum.Font.Gotham; UI.conflictDesc.TextSize = 11; UI.conflictDesc.TextColor3 = THEME.Text; UI.conflictDesc.TextWrapped = true; UI.conflictDesc.TextXAlignment = Enum.TextXAlignment.Left; UI.conflictDesc.TextYAlignment = Enum.TextYAlignment.Top; UI.conflictDesc.Text = ""; UI.conflictDesc.Parent = UI.conflictCard
UI.conflictUploadBtn = Instance.new("TextButton"); UI.conflictUploadBtn.Size = UDim2.new(1, -20, 0, 26); UI.conflictUploadBtn.Position = UDim2.new(0, 10, 0, 58); UI.conflictUploadBtn.BackgroundColor3 = THEME.Accent; UI.conflictUploadBtn.TextColor3 = Color3.new(1, 1, 1); UI.conflictUploadBtn.Font = Enum.Font.GothamBold; UI.conflictUploadBtn.TextSize = 11; UI.conflictUploadBtn.Text = "Моя карта на сервер"; UI.conflictUploadBtn.Parent = UI.conflictCard; addCorner(UI.conflictUploadBtn, 6); UI.conflictUploadStroke = addStroke(UI.conflictUploadBtn, THEME.Accent, 1)
UI.conflictDownloadBtn = Instance.new("TextButton"); UI.conflictDownloadBtn.Size = UDim2.new(0.62, -13, 0, 26); UI.conflictDownloadBtn.Position = UDim2.new(0, 10, 0, 90); UI.conflictDownloadBtn.BackgroundColor3 = THEME.SurfaceHover; UI.conflictDownloadBtn.TextColor3 = THEME.Text; UI.conflictDownloadBtn.Font = Enum.Font.GothamBold; UI.conflictDownloadBtn.TextSize = 11; UI.conflictDownloadBtn.Text = "Скачать с сервера"; UI.conflictDownloadBtn.Parent = UI.conflictCard; addCorner(UI.conflictDownloadBtn, 6); UI.conflictDownloadStroke = addStroke(UI.conflictDownloadBtn, THEME.Border, 1)
UI.conflictCancelBtn = Instance.new("TextButton"); UI.conflictCancelBtn.Size = UDim2.new(0.38, -13, 0, 26); UI.conflictCancelBtn.Position = UDim2.new(0.62, 3, 0, 90); UI.conflictCancelBtn.BackgroundColor3 = Color3.fromRGB(64, 28, 32); UI.conflictCancelBtn.TextColor3 = Color3.fromRGB(252, 165, 165); UI.conflictCancelBtn.Font = Enum.Font.GothamBold; UI.conflictCancelBtn.TextSize = 11; UI.conflictCancelBtn.Text = "Отмена"; UI.conflictCancelBtn.Parent = UI.conflictCard; addCorner(UI.conflictCancelBtn, 6); addStroke(UI.conflictCancelBtn, THEME.Danger, 1)
local ttCard = Instance.new("Frame"); ttCard.Size = UDim2.new(1, 0, 0, 46); ttCard.BackgroundColor3 = THEME.Surface; ttCard.LayoutOrder = 5; ttCard.Parent = UI.pageSync; addCorner(ttCard, 8); UI.teamTestStroke = addStroke(ttCard, THEME.Border, 1)
local ttTitle = Instance.new("TextLabel"); ttTitle.Size = UDim2.new(1, -104, 0, 17); ttTitle.Position = UDim2.new(0, 12, 0, 6); ttTitle.BackgroundTransparency = 1; ttTitle.Font = Enum.Font.GothamBold; ttTitle.TextSize = 12; ttTitle.TextColor3 = THEME.Text; ttTitle.TextXAlignment = Enum.TextXAlignment.Left; ttTitle.Text = "Team Test"; ttTitle.Parent = ttCard
UI.ttSub = Instance.new("TextLabel"); UI.ttSub.Size = UDim2.new(1, -104, 0, 15); UI.ttSub.Position = UDim2.new(0, 12, 0, 24); UI.ttSub.BackgroundTransparency = 1; UI.ttSub.Font = Enum.Font.Gotham; UI.ttSub.TextSize = 11; UI.ttSub.TextColor3 = THEME.TextMuted; UI.ttSub.TextXAlignment = Enum.TextXAlignment.Left; UI.ttSub.Text = "Аватары друзей в Play (F5)"; UI.ttSub.Parent = ttCard
UI.teamTestBtn = Instance.new("TextButton"); UI.teamTestBtn.Size = UDim2.new(0, 82, 0, 26); UI.teamTestBtn.Position = UDim2.new(1, -92, 0.5, -13); UI.teamTestBtn.BackgroundColor3 = Color3.fromRGB(30, 128, 74); UI.teamTestBtn.TextColor3 = Color3.new(1, 1, 1); UI.teamTestBtn.Font = Enum.Font.GothamBold; UI.teamTestBtn.TextSize = 11; UI.teamTestBtn.Text = "Позвать"; UI.teamTestBtn.Parent = ttCard; addCorner(UI.teamTestBtn, 6)
local sCard = Instance.new("Frame"); sCard.Size = UDim2.new(1, 0, 0, 160); sCard.BackgroundColor3 = THEME.Surface; sCard.LayoutOrder = 6; sCard.Parent = UI.pageSync; addCorner(sCard, 8); addStroke(sCard, THEME.Border, 1)