-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAnimations
More file actions
666 lines (552 loc) · 19.9 KB
/
Copy pathAnimations
File metadata and controls
666 lines (552 loc) · 19.9 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
--This is not a really important thing for you to scam it, ok? little skid.
return function(Background, Moving_Section, Alert_Label, r, g, b, CreateClicker, CreateToggle, SendNotify, StopAnim)
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local RunService = game:GetService("RunService")
local plr = Players.LocalPlayer
local DATA_URL = "https://raw.githubusercontent.com/DRYF-1/Roblox-Emote/main/AnimationSniper.json"
local FAV_FILE = "VR7_FavAnims.json"
local State = {
AnimationCache = {},
isLoading = false
}
local Favorites = {}
if isfile and readfile then
if isfile(FAV_FILE) then
local Success, Result = pcall(function() return HttpService:JSONDecode(readfile(FAV_FILE)) end)
if Success and type(Result) == "table" then
Favorites = Result
end
end
end
local function SaveFavorites()
if writefile then
pcall(function() writefile(FAV_FILE, HttpService:JSONEncode(Favorites)) end)
end
end
local FallbackCategoryMap = {
["1"] = "idle", ["2"] = "walk", ["3"] = "run",
["4"] = "jump", ["5"] = "fall", ["6"] = "climb", ["7"] = "swim"
}
local SavedAnimations = {}
local ArabicNames = {
Idle = "الوقفة",
Walk = "المشية",
Run = "الركضة",
Jump = "القفزة",
Climb = "التسلق",
Fall = "السقوط",
Swim = "السباحة"
}
local Order = {"Idle", "Walk", "Run", "Jump", "Climb", "Fall", "Swim"}
local function CopyTable(Source)
local NewTable = {}
for Key, Value in pairs(Source) do
NewTable[Key] = Value
end
return NewTable
end
local function CreateButton(Name, Text, Parent, IsButton)
local ButtonTemplate = Instance.new("TextButton")
ButtonTemplate.BackgroundColor3 = Color3.fromRGB(r, g, b)
ButtonTemplate.TextColor3 = Color3.fromRGB(0, 0, 0)
ButtonTemplate.Font = Enum.Font.Oswald
ButtonTemplate.Size = UDim2.new(0, 150, 0, 30)
ButtonTemplate.BackgroundTransparency = 0.5
ButtonTemplate.BorderSizePixel = 0
ButtonTemplate.TextScaled = true
ButtonTemplate.TextWrapped = true
ButtonTemplate.Name = Name
ButtonTemplate.Text = Text
ButtonTemplate.Parent = Parent
getgenv()[Name] = ButtonTemplate
if IsButton == nil then
if CreateClicker then CreateClicker(ButtonTemplate) end
elseif IsButton == true then
if CreateToggle then CreateToggle(ButtonTemplate) end
end
return ButtonTemplate
end
local function SaveCategoryFromPack(PackTable, TargetCategory)
for Path, Id in pairs(PackTable) do
local CurrentCategory = string.match(Path, "^(.-)/")
local CurrentCategoryKey = CurrentCategory and CurrentCategory:sub(1, 1):upper() .. CurrentCategory:sub(2):lower()
if CurrentCategoryKey == TargetCategory then
SavedAnimations[Path] = Id
end
end
end
local function ApplySavedAnimations(Character)
if not Character or not next(SavedAnimations) then return end
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if not Humanoid or Humanoid.RigType ~= Enum.HumanoidRigType.R15 then return end
local Animate = Character:WaitForChild("Animate")
if StopAnim then StopAnim() end
for Path, Id in pairs(SavedAnimations) do
local Obj = Animate
for Segment in string.gmatch(Path, "[^/]+") do
Obj = Obj:FindFirstChild(Segment)
if not Obj then break end
end
if Obj and Obj:IsA("Animation") then
Obj.AnimationId = Id
end
end
Animate.Disabled = true
task.wait()
Animate.Disabled = false
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
for _, Track in pairs(Animator:GetPlayingAnimationTracks()) do
Track:Stop(0)
Track:Destroy()
end
end
Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
task.wait(0.01)
Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
end
local function ApplyCategoryPack(PackTable, TargetCategory)
local Character = plr.Character
if not Character then return end
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if not Humanoid or Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
if SendNotify then SendNotify("System VR7", "يجب ان تكون R15", 7) end
return
end
local Animate = Character:FindFirstChild("Animate")
if not Animate then return end
if StopAnim then StopAnim() end
local Applied = false
for Path, Id in pairs(PackTable) do
local CurrentCategory = string.match(Path, "^(.-)/")
local CurrentCategoryKey = CurrentCategory and CurrentCategory:sub(1, 1):upper() .. CurrentCategory:sub(2):lower()
if CurrentCategoryKey == TargetCategory then
local Obj = Animate
for Segment in string.gmatch(Path, "[^/]+") do
Obj = Obj:FindFirstChild(Segment)
if not Obj then break end
end
if Obj and Obj:IsA("Animation") then
Obj.AnimationId = Id
Applied = true
end
end
end
if not Applied then
if SendNotify then SendNotify("System VR7", "ماكو انميشنات لهذا القسم", 2) end
return
end
SaveCategoryFromPack(PackTable, TargetCategory)
Animate.Disabled = true
task.wait()
Animate.Disabled = false
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
for _, Track in pairs(Animator:GetPlayingAnimationTracks()) do
Track:Stop(0)
Track:Destroy()
end
end
Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
task.wait(0.01)
Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
if SendNotify then SendNotify("System VR7", "تم اختيار " .. (ArabicNames[TargetCategory] or TargetCategory), 1) end
end
local function ApplyAnimPack(AnimData)
SavedAnimations = CopyTable(AnimData)
local Character = plr.Character
if not Character then return end
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if not Humanoid or Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
if SendNotify then SendNotify("System VR7", "يجب ان تكون R15", 7) end
return
end
local Animate = Character:WaitForChild("Animate")
if StopAnim then StopAnim() end
for Path, Id in pairs(AnimData) do
local Obj = Animate
for Segment in string.gmatch(Path, "[^/]+") do
Obj = Obj:FindFirstChild(Segment)
if not Obj then break end
end
if Obj and Obj:IsA("Animation") then
Obj.AnimationId = Id
end
end
Animate.Disabled = true
task.wait()
Animate.Disabled = false
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
for _, Track in pairs(Animator:GetPlayingAnimationTracks()) do
Track:Stop(0)
Track:Destroy()
end
end
Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
task.wait(0.01)
Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
if SendNotify then SendNotify("System VR7", "تم اختيار المشية", 1) end
end
local CacheFileName = "AnimationCache.json"
local function LoadCacheFile()
if isfile and isfile(CacheFileName) then
local Success, Content = pcall(readfile, CacheFileName)
if Success then
local DecodeSuccess, DecodedTable = pcall(function()
return game:GetService("HttpService"):JSONDecode(Content)
end)
if DecodeSuccess and type(DecodedTable) == "table" then
return DecodedTable
end
end
end
return {}
end
local function SaveCacheFile(CacheData)
if writefile then
pcall(function()
local EncodedContent = game:GetService("HttpService"):JSONEncode(CacheData)
writefile(CacheFileName, EncodedContent)
end)
end
end
local function ResolveAnimationMappings(BundledItems)
local Mappings = {}
local FileCache = LoadCacheFile()
local IsCacheUpdated = false
local LoadCounter = 0
for Key, AssetIds in pairs(BundledItems) do
local IdsToProcess = type(AssetIds) == "table" and AssetIds or {AssetIds}
for _, AssetId in pairs(IdsToProcess) do
local CleanId = tonumber(AssetId)
if not CleanId or CleanId == 0 then continue end
local StringId = tostring(CleanId)
if FileCache[StringId] then
for PathKey, AnimId in pairs(FileCache[StringId]) do
Mappings[PathKey] = AnimId
end
continue
end
local Success, Objects = pcall(function()
return game:GetObjects("rbxassetid://" .. CleanId)
end)
FileCache[StringId] = {}
IsCacheUpdated = true
if Success and Objects and #Objects > 0 then
for _, Obj in pairs(Objects) do
for _, Descendant in ipairs(Obj:GetDescendants()) do
if Descendant:IsA("Animation") and Descendant.AnimationId and Descendant.AnimationId ~= "" then
local ExtractedCategory = Descendant.Parent.Name or FallbackCategoryMap[tostring(Key)] or "idle"
local PathKey = ExtractedCategory .. "/" .. Descendant.Name
Mappings[PathKey] = Descendant.AnimationId
FileCache[StringId][PathKey] = Descendant.AnimationId
end
end
Obj:Destroy()
end
end
LoadCounter = LoadCounter + 1
if LoadCounter >= 2 then
RunService.Heartbeat:Wait()
LoadCounter = 0
end
end
end
if IsCacheUpdated then
SaveCacheFile(FileCache)
end
return Mappings
end
local function CreateSubSectionUI(NameKey, DisplayName, PackData, SearchBarRef)
local SectionName = NameKey .. "_Section"
local NewSection = Instance.new("ScrollingFrame")
NewSection.Name = SectionName
NewSection.Parent = Background
NewSection.Active = true
NewSection.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
NewSection.BackgroundTransparency = 1
NewSection.BorderColor3 = Color3.fromRGB(0, 0, 0)
NewSection.BorderSizePixel = 0
NewSection.Position = UDim2.new(0, 105, 0, 30)
NewSection.Size = UDim2.new(0, 395, 0, 320)
NewSection.Visible = true
NewSection.CanvasSize = UDim2.new(0, 0, 0, 0)
NewSection.ScrollBarThickness = 5
NewSection.AutomaticCanvasSize = Enum.AutomaticSize.Y
local Mdre = Alert_Label:Clone()
Mdre.Parent = NewSection
Mdre.Text = DisplayName
Mdre.Position = UDim2.new(0, 0, 0, 0)
Mdre.Size = UDim2.new(1, 0, 0, 30)
Mdre.BackgroundTransparency = 1
local ButtonsHolder = Instance.new("Frame")
ButtonsHolder.Name = "ButtonsHolder"
ButtonsHolder.Parent = NewSection
ButtonsHolder.BackgroundTransparency = 1
ButtonsHolder.Position = UDim2.new(0, 0, 0, 40)
ButtonsHolder.Size = UDim2.new(1, 0, 0, 0)
ButtonsHolder.AutomaticSize = Enum.AutomaticSize.Y
local Tezk = Instance.new("UIGridLayout")
Tezk.Parent = ButtonsHolder
Tezk.CellPadding = UDim2.new(0, 40, 0, 20)
Tezk.CellSize = UDim2.new(0, 150, 0, 30)
Tezk.HorizontalAlignment = Enum.HorizontalAlignment.Center
Tezk.VerticalAlignment = Enum.VerticalAlignment.Top
Tezk.StartCorner = Enum.StartCorner.TopLeft
Tezk.SortOrder = Enum.SortOrder.LayoutOrder
local Tezk1 = Instance.new("UIPadding")
Tezk1.Parent = ButtonsHolder
Tezk1.PaddingRight = UDim.new(0, 20)
Tezk1.PaddingTop = UDim.new(0, 10)
Tezk1.PaddingBottom = UDim.new(0, 20)
local BackButton = Instance.new("TextButton")
BackButton.BackgroundColor3 = Color3.fromRGB(r, g, b)
BackButton.TextColor3 = Color3.fromRGB(0, 0, 0)
BackButton.Font = Enum.Font.Oswald
BackButton.Size = UDim2.new(0, 150, 0, 30)
BackButton.BackgroundTransparency = 0.5
BackButton.BorderSizePixel = 0
BackButton.TextScaled = true
BackButton.TextWrapped = true
BackButton.Name = "Back"
BackButton.Text = "رجوع"
BackButton.LayoutOrder = 1
BackButton.Parent = ButtonsHolder
if CreateClicker then CreateClicker(BackButton) end
BackButton.MouseButton1Click:Connect(function()
NewSection.Visible = false
Moving_Section.Visible = true
if SearchBarRef then
SearchBarRef.Visible = true
end
NewSection:Destroy()
end)
local AllButton = Instance.new("TextButton")
AllButton.BackgroundColor3 = Color3.fromRGB(r, g, b)
AllButton.TextColor3 = Color3.fromRGB(0, 0, 0)
AllButton.Font = Enum.Font.Oswald
AllButton.Size = UDim2.new(0, 150, 0, 30)
AllButton.BackgroundTransparency = 0.5
AllButton.BorderSizePixel = 0
AllButton.TextScaled = true
AllButton.TextWrapped = true
AllButton.Name = "All"
AllButton.Text = "كل الانميشن"
AllButton.LayoutOrder = 2
AllButton.Parent = ButtonsHolder
if CreateClicker then CreateClicker(AllButton) end
AllButton.MouseButton1Click:Connect(function()
ApplyAnimPack(PackData)
end)
local AddedCategories = {}
local LayoutIndex = 3
for _, OrderedCategory in ipairs(Order) do
for FullName, _ in pairs(PackData) do
local Category = string.match(FullName, "^(.-)/")
local CategoryKey = Category and Category:sub(1, 1):upper() .. Category:sub(2):lower()
if CategoryKey == OrderedCategory and not AddedCategories[CategoryKey] then
AddedCategories[CategoryKey] = true
local ThisCategoryKey = CategoryKey
local ThisLayoutIndex = LayoutIndex
LayoutIndex += 1
local ButtonTemplate = Instance.new("TextButton")
ButtonTemplate.BackgroundColor3 = Color3.fromRGB(r, g, b)
ButtonTemplate.TextColor3 = Color3.fromRGB(0, 0, 0)
ButtonTemplate.Font = Enum.Font.Oswald
ButtonTemplate.Size = UDim2.new(0, 150, 0, 30)
ButtonTemplate.BackgroundTransparency = 0.5
ButtonTemplate.BorderSizePixel = 0
ButtonTemplate.TextScaled = true
ButtonTemplate.TextWrapped = true
ButtonTemplate.Name = ThisCategoryKey
ButtonTemplate.Text = ArabicNames[ThisCategoryKey] or ThisCategoryKey
ButtonTemplate.LayoutOrder = ThisLayoutIndex
ButtonTemplate.Parent = ButtonsHolder
if CreateClicker then CreateClicker(ButtonTemplate) end
ButtonTemplate.MouseButton1Click:Connect(function()
ApplyCategoryPack(PackData, ThisCategoryKey)
end)
break
end
end
end
end
local function InitializeDynamicUI()
for _, child in ipairs(Moving_Section:GetChildren()) do
if child:IsA("UIGridLayout") or child:IsA("UIListLayout") then
child.SortOrder = Enum.SortOrder.LayoutOrder
end
end
local Folder = Instance.new("Folder")
Folder.Parent = Moving_Section
local SearchBar = Instance.new("TextBox")
SearchBar.Name = "AnimSearchBar"
SearchBar.Parent = Folder
SearchBar.BackgroundColor3 = Color3.fromRGB(r, g, b)
SearchBar.TextColor3 = Color3.fromRGB(0, 0, 0)
SearchBar.Font = Enum.Font.Oswald
SearchBar.Size = UDim2.new(0, 385, 0, 30)
SearchBar.Position = UDim2.new(0, 6, 0, -40)
SearchBar.BackgroundTransparency = 0.5
SearchBar.BorderSizePixel = 0
SearchBar.TextScaled = true
SearchBar.TextWrapped = true
SearchBar.PlaceholderText = "ابحث عن المشية..."
SearchBar.PlaceholderColor3 = Color3.fromRGB(50, 50, 50)
SearchBar.Text = ""
local Success, Response = pcall(function() return game:HttpGet(DATA_URL) end)
if not Success or not Response then return end
local DecodedData = HttpService:JSONDecode(Response)
if not DecodedData or not DecodedData.data then return end
local UniquePacksArray = {}
local PackIndexMap = {}
for _, Pack in ipairs(DecodedData.data) do
if Pack.bundledItems and Pack.name then
local CleanName = Pack.name:gsub("[:%.]", "")
CleanName = CleanName:gsub("%s+[bB][yY].*", "")
CleanName = CleanName:sub(1, 1):upper() .. CleanName:sub(2)
if PackIndexMap[CleanName] then
UniquePacksArray[PackIndexMap[CleanName]] = Pack
else
Pack.name = CleanName
table.insert(UniquePacksArray, Pack)
PackIndexMap[CleanName] = #UniquePacksArray
end
end
end
local DefaultAnimPack = {
name = "المشية الاعتيادية",
bundledItems = "DEFAULT_ANIMATIONS_KEY"
}
table.insert(UniquePacksArray, 1, DefaultAnimPack)
State.AnimationCache[HttpService:JSONEncode("DEFAULT_ANIMATIONS_KEY")] = {
["idle/Animation1"] = "rbxassetid://2510196951",
["idle/Animation2"] = "rbxassetid://2510197257",
["walk/WalkAnim"] = "rbxassetid://2510202577",
["run/RunAnim"] = "rbxassetid://2510198475",
["jump/JumpAnim"] = "rbxassetid://2510197830",
["climb/ClimbAnim"] = "rbxassetid://2510192778",
["fall/FallAnim"] = "rbxassetid://2510195892",
["swim/SwimAnim"] = "rbxassetid://2510203414",
}
local SectionLayout = Moving_Section:FindFirstChildOfClass("UIGridLayout") or Moving_Section:FindFirstChildOfClass("UIListLayout")
if SectionLayout then
SectionLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
Moving_Section.CanvasSize = UDim2.new(0, 0, 0, SectionLayout.AbsoluteContentSize.Y + 20)
end)
Moving_Section.CanvasSize = UDim2.new(0, 0, 0, SectionLayout.AbsoluteContentSize.Y + 20)
else
Moving_Section.AutomaticCanvasSize = Enum.AutomaticSize.Y
end
local PackButtons = {}
local FirstFavPack = nil
for Index, Pack in ipairs(UniquePacksArray) do
local NameKey = Pack.name:gsub("%s+", "")
if Favorites[NameKey] and not FirstFavPack then
FirstFavPack = Pack
end
local Btn = CreateButton(NameKey, Pack.name, Moving_Section, nil)
local StarBtn = Instance.new("TextButton")
StarBtn.Name = "FavStar"
StarBtn.Parent = Btn
StarBtn.BackgroundTransparency = 1
StarBtn.Size = UDim2.new(0, 30, 1, 0)
StarBtn.Position = UDim2.new(1, -30, 0, 0)
StarBtn.Font = Enum.Font.Gotham
StarBtn.TextSize = 18
StarBtn.Text = Favorites[NameKey] and utf8.char(0x2B50) or utf8.char(0x2605)
StarBtn.Active = true
Btn.LayoutOrder = Favorites[NameKey] and (Index - 10000) or Index
table.insert(PackButtons, Btn)
StarBtn.MouseButton1Click:Connect(function()
if Favorites[NameKey] then
Favorites[NameKey] = nil
StarBtn.Text = utf8.char(0x2605)
Btn.LayoutOrder = Index
else
Favorites[NameKey] = true
StarBtn.Text = utf8.char(0x2B50)
Btn.LayoutOrder = Index - 10000
end
SaveFavorites()
end)
Btn.MouseButton1Click:Connect(function()
local SectionName = NameKey .. "_Section"
local ExistingSection = Background:FindFirstChild(SectionName)
if ExistingSection then
Moving_Section.Visible = false
SearchBar.Visible = false
ExistingSection.Visible = true
return
end
local OriginalText = Btn.Text
local CacheKey = HttpService:JSONEncode(Pack.bundledItems)
local PackData = State.AnimationCache[CacheKey]
if not PackData then
Btn.Text = "جاري التحميل..."
coroutine.wrap(function()
local success, err = pcall(function()
PackData = ResolveAnimationMappings(Pack.bundledItems)
end)
if not success then
Btn.Text = "حدث خطأ"
warn("Error in ResolveAnimationMappings: " .. tostring(err))
return
end
State.AnimationCache[CacheKey] = PackData
Btn.Text = OriginalText
if not PackData or not next(PackData) then
if SendNotify then SendNotify("System VR7", "هذه الحزمة فارغة أو غير صالحة", 3) end
return
end
Moving_Section.Visible = false
SearchBar.Visible = false
CreateSubSectionUI(NameKey, Pack.name, PackData, SearchBar)
end)()
return
end
if not next(PackData) then
if SendNotify then SendNotify("System VR7", "هذه الحزمة فارغة أو غير صالحة", 3) end
return
end
Moving_Section.Visible = false
SearchBar.Visible = false
CreateSubSectionUI(NameKey, Pack.name, PackData, SearchBar)
end)
end
SearchBar:GetPropertyChangedSignal("Text"):Connect(function()
local Query = SearchBar.Text:lower()
local VisibleCount = 0
for _, Btn in ipairs(PackButtons) do
local BtnText = Btn.Text:lower()
if Query == "" or string.sub(BtnText, 1, #Query) == Query then
Btn.Visible = true
VisibleCount = VisibleCount + 1
else
Btn.Visible = false
end
end
end)
if FirstFavPack then
task.spawn(function()
local CacheKey = HttpService:JSONEncode(FirstFavPack.bundledItems)
local PackData = State.AnimationCache[CacheKey]
if not PackData then
PackData = ResolveAnimationMappings(FirstFavPack.bundledItems)
State.AnimationCache[CacheKey] = PackData
end
--[[if PackData and next(PackData) then
ApplyAnimPack(PackData)
end]]
end)
end
end
task.spawn(InitializeDynamicUI)
plr.CharacterAdded:Connect(function(Character)
task.wait(0.5)
ApplySavedAnimations(Character)
end)
end