Dark_Agent

Animation Manager

Oct 12th, 2025
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 37.64 KB | Gaming | 0 0
  1. cloneref = type(cloneref) == "function" and cloneref or function(...) return ... end
  2.  
  3. local CoreGui = cloneref(game:GetService("CoreGui"))
  4. local Players = cloneref(game:GetService("Players"))
  5. local RunService = cloneref(game:GetService("RunService"))
  6. local UserInputService = cloneref(game:GetService("UserInputService"))
  7.  
  8. if CoreGui:FindFirstChild("AnimationManager") then
  9.     CoreGui.AnimationManager:Destroy()
  10. end
  11.  
  12. local Gui = Instance.new("ScreenGui")
  13. Gui.Name = "AnimationManager"
  14. Gui.ZIndexBehavior = Enum.ZIndexBehavior.Global
  15. Gui.IgnoreGuiInset = true
  16. Gui.Parent = CoreGui
  17.  
  18. local function New(class, props, children)
  19.     local o = Instance.new(class)
  20.     if props then
  21.         for k, v in pairs(props) do
  22.             o[k] = v
  23.         end
  24.     end
  25.     if children then
  26.         for _, c in ipairs(children) do
  27.             c.Parent = o
  28.         end
  29.     end
  30.     return o
  31. end
  32.  
  33. local function MakeButton(text, size)
  34.     local b = New("TextButton", {
  35.         Size = size or UDim2.new(0, 150, 0, 36),
  36.         BackgroundColor3 = Color3.fromRGB(40, 40, 40),
  37.         Text = text,
  38.         Font = Enum.Font.GothamBold,
  39.         TextSize = 14,
  40.         TextColor3 = Color3.fromRGB(235, 235, 235),
  41.         AutoButtonColor = false
  42.     })
  43.     New("UICorner", { CornerRadius = UDim.new(0, 6), Parent = b })
  44.     New("UIStroke", { Thickness = 1, Color = Color3.fromRGB(70, 70, 70), Parent = b })
  45.     return b
  46. end
  47.  
  48. local function MakeInput(placeholder, size)
  49.     local tb = New("TextBox", {
  50.         Size = size or UDim2.new(0, 306, 0, 36),
  51.         BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  52.         PlaceholderText = placeholder,
  53.         Font = Enum.Font.Gotham,
  54.         TextSize = 14,
  55.         TextColor3 = Color3.fromRGB(235, 235, 235),
  56.         BorderSizePixel = 0,
  57.         ClearTextOnFocus = false
  58.     })
  59.     New("UICorner", { CornerRadius = UDim.new(0, 6), Parent = tb })
  60.     New("UIStroke", { Thickness = 1, Color = Color3.fromRGB(70, 70, 70), Parent = tb })
  61.     return tb
  62. end
  63.  
  64. local function MakeSlider(labelText, minValue, maxValue, defaultValue, width)
  65.     local holder = New("Frame", {
  66.         Size = UDim2.new(0, width or 306, 0, 38),
  67.         BackgroundColor3 = Color3.fromRGB(24, 24, 24),
  68.         BackgroundTransparency = 0.25,
  69.         BorderSizePixel = 0
  70.     })
  71.     New("UICorner", { CornerRadius = UDim.new(0, 6), Parent = holder })
  72.     New("UIStroke", { Thickness = 1, Color = Color3.fromRGB(60, 60, 60), Parent = holder })
  73.  
  74.     local label = New("TextLabel", {
  75.         BackgroundTransparency = 1,
  76.         Text = labelText .. ": " .. string.format("%.2f", defaultValue),
  77.         Font = Enum.Font.Gotham,
  78.         TextSize = 12,
  79.         TextColor3 = Color3.fromRGB(220, 220, 220),
  80.         TextXAlignment = Enum.TextXAlignment.Left,
  81.         Size = UDim2.new(1, -16, 0, 16),
  82.         Position = UDim2.new(0, 8, 0, 4)
  83.     })
  84.     label.Parent = holder
  85.  
  86.     local bar = New("Frame", {
  87.         BackgroundColor3 = Color3.fromRGB(40, 40, 40),
  88.         BorderSizePixel = 0,
  89.         Size = UDim2.new(1, -16, 0, 12),
  90.         Position = UDim2.new(0, 8, 0, 22)
  91.     })
  92.     bar.Parent = holder
  93.     New("UICorner", { CornerRadius = UDim.new(0, 6), Parent = bar })
  94.  
  95.     local fill = New("Frame", {
  96.         BackgroundColor3 = Color3.fromRGB(90, 140, 90),
  97.         BorderSizePixel = 0,
  98.         Size = UDim2.new((defaultValue - minValue) / (maxValue - minValue), 0, 1, 0)
  99.     })
  100.     fill.Parent = bar
  101.     New("UICorner", { CornerRadius = UDim.new(0, 6), Parent = fill })
  102.  
  103.     local value = defaultValue
  104.     local dragging = false
  105.  
  106.     bar.InputBegan:Connect(function(i)
  107.         if i.UserInputType == Enum.UserInputType.MouseButton1 then
  108.             dragging = true
  109.         end
  110.     end)
  111.  
  112.     bar.InputEnded:Connect(function(i)
  113.         if i.UserInputType == Enum.UserInputType.MouseButton1 then
  114.             dragging = false
  115.         end
  116.     end)
  117.  
  118.     bar.InputChanged:Connect(function(i)
  119.         if dragging and i.UserInputType == Enum.UserInputType.MouseMovement then
  120.             local total = bar.AbsoluteSize.X
  121.             local px = math.clamp(i.Position.X - bar.AbsolutePosition.X, 0, total)
  122.             local alpha = total > 0 and (px / total) or 0
  123.             value = minValue + alpha * (maxValue - minValue)
  124.             fill.Size = UDim2.new(alpha, 0, 1, 0)
  125.             label.Text = labelText .. ": " .. string.format("%.2f", value)
  126.         end
  127.     end)
  128.  
  129.     local function get()
  130.         return value
  131.     end
  132.  
  133.     local function set(x)
  134.         local alpha = math.clamp((x - minValue) / (maxValue - minValue), 0, 1)
  135.         value = x
  136.         fill.Size = UDim2.new(alpha, 0, 1, 0)
  137.         label.Text = labelText .. ": " .. string.format("%.2f", value)
  138.     end
  139.  
  140.     return holder, get, set
  141. end
  142.  
  143. local Root = New("Frame", {
  144.     Name = "Root",
  145.     Size = UDim2.new(0, 900, 0, 600),
  146.     Position = UDim2.new(0.5, -450, 0.5, -300),
  147.     BackgroundColor3 = Color3.fromRGB(15, 15, 15),
  148.     Parent = Gui
  149. })
  150.  
  151. local Header = New("Frame", {
  152.     Name = "Header",
  153.     Size = UDim2.new(1, 0, 0, 40),
  154.     BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  155.     Parent = Root
  156. })
  157.  
  158. local Title = New("TextLabel", {
  159.     Text = "Animation Manager",
  160.     Size = UDim2.new(1, -120, 1, 0),
  161.     Position = UDim2.new(0, 10, 0, 0),
  162.     BackgroundTransparency = 1,
  163.     Font = Enum.Font.GothamBold,
  164.     TextSize = 18,
  165.     TextColor3 = Color3.fromRGB(240, 240, 240),
  166.     TextXAlignment = Enum.TextXAlignment.Left,
  167.     Parent = Header
  168. })
  169.  
  170. local MinBtn = MakeButton("-", UDim2.new(0, 32, 0, 24))
  171. MinBtn.Position = UDim2.new(1, -74, 0, 8)
  172. MinBtn.Parent = Header
  173.  
  174. local CloseBtn = MakeButton("X", UDim2.new(0, 32, 0, 24))
  175. CloseBtn.Position = UDim2.new(1, -38, 0, 8)
  176. CloseBtn.Parent = Header
  177.  
  178. local Dragging = false
  179. local DragStart = nil
  180. local RootStart = nil
  181. local Minimized = false
  182. local StoredSize = Root.Size
  183. local StoredPos = Root.Position
  184.  
  185. Header.InputBegan:Connect(function(i)
  186.     if i.UserInputType == Enum.UserInputType.MouseButton1 then
  187.         Dragging = true
  188.         DragStart = i.Position
  189.         RootStart = Root.Position
  190.     end
  191. end)
  192.  
  193. Header.InputChanged:Connect(function(i)
  194.     if Dragging and i.UserInputType == Enum.UserInputType.MouseMovement then
  195.         local d = i.Position - DragStart
  196.         Root.Position = UDim2.new(RootStart.X.Scale, RootStart.X.Offset + d.X, RootStart.Y.Scale, RootStart.Y.Offset + d.Y)
  197.     end
  198. end)
  199.  
  200. Header.InputEnded:Connect(function(i)
  201.     if i.UserInputType == Enum.UserInputType.MouseButton1 then
  202.         Dragging = false
  203.     end
  204. end)
  205.  
  206. CloseBtn.MouseButton1Click:Connect(function()
  207.     Gui:Destroy()
  208. end)
  209.  
  210. local Body = New("Frame", {
  211.     Name = "Body",
  212.     Size = UDim2.new(1, 0, 1, -40),
  213.     Position = UDim2.new(0, 0, 0, 40),
  214.     BackgroundTransparency = 1,
  215.     Parent = Root
  216. })
  217.  
  218. MinBtn.MouseButton1Click:Connect(function()
  219.     Minimized = not Minimized
  220.     if Minimized then
  221.         StoredSize = Root.Size
  222.         StoredPos = Root.Position
  223.         Root.Size = UDim2.new(0, 360, 0, 40)
  224.         Body.Visible = false
  225.     else
  226.         Root.Size = StoredSize
  227.         Root.Position = StoredPos
  228.         Body.Visible = true
  229.     end
  230. end)
  231.  
  232. local LeftPane = New("Frame", {
  233.     Name = "LeftPane",
  234.     Size = UDim2.new(0.42, 0, 1, 0),
  235.     BackgroundTransparency = 1,
  236.     Parent = Body
  237. })
  238.  
  239. local RightPane = New("Frame", {
  240.     Name = "RightPane",
  241.     Size = UDim2.new(0.58, 0, 1, 0),
  242.     Position = UDim2.new(0.42, 0, 0, 0),
  243.     BackgroundTransparency = 1,
  244.     Parent = Body
  245. })
  246.  
  247. local TopBarLeft = New("Frame", {
  248.     Name = "TopBarLeft",
  249.     Size = UDim2.new(1, -12, 0, 36),
  250.     Position = UDim2.new(0, 6, 0, 6),
  251.     BackgroundTransparency = 1,
  252.     Parent = LeftPane
  253. })
  254.  
  255. local SearchBar = MakeInput("Filter by name or ID", UDim2.new(1, 0, 1, 0))
  256. SearchBar.Parent = TopBarLeft
  257.  
  258. local AnimLogger = New("ScrollingFrame", {
  259.     Name = "AnimLogger",
  260.     Size = UDim2.new(1, -12, 1, -56),
  261.     Position = UDim2.new(0, 6, 0, 50),
  262.     BackgroundColor3 = Color3.fromRGB(12, 12, 12),
  263.     BackgroundTransparency = 0.15,
  264.     ScrollBarThickness = 8,
  265.     ScrollingDirection = Enum.ScrollingDirection.Y,
  266.     CanvasSize = UDim2.new(0, 0, 0, 0),
  267.     Active = true,
  268.     Parent = LeftPane
  269. })
  270.  
  271. local AnimLoggerLayout = New("UIListLayout", {
  272.     Padding = UDim.new(0, 6),
  273.     SortOrder = Enum.SortOrder.LayoutOrder,
  274.     Parent = AnimLogger
  275. })
  276.  
  277. local TopBarRight = New("Frame", {
  278.     Name = "TopBarRight",
  279.     Size = UDim2.new(1, -12, 0, 36),
  280.     Position = UDim2.new(0, 6, 0, 6),
  281.     BackgroundTransparency = 1,
  282.     Parent = RightPane
  283. })
  284.  
  285. local AnimIdInput = MakeInput("numeric or rbxassetid://", UDim2.new(1, 0, 1, 0))
  286. AnimIdInput.Parent = TopBarRight
  287.  
  288. local PreviewContainer = New("Frame", {
  289.     Name = "PreviewContainer",
  290.     BackgroundColor3 = Color3.fromRGB(16, 16, 16),
  291.     BackgroundTransparency = 0.15,
  292.     BorderSizePixel = 0,
  293.     Size = UDim2.new(1, -12, 0.48, -50),
  294.     Position = UDim2.new(0, 6, 0, 50),
  295.     Parent = RightPane
  296. })
  297.  
  298. local Viewport = New("ViewportFrame", {
  299.     Name = "Viewport",
  300.     BackgroundColor3 = Color3.fromRGB(8, 8, 8),
  301.     BackgroundTransparency = 0.2,
  302.     BorderSizePixel = 0,
  303.     Size = UDim2.new(1, 0, 1, 0),
  304.     Active = true,
  305.     Parent = PreviewContainer
  306. })
  307.  
  308. local Camera = New("Camera", { Parent = Viewport })
  309. Viewport.CurrentCamera = Camera
  310.  
  311. local RotateBtn = MakeButton("🔁", UDim2.new(0, 28, 0, 22))
  312. RotateBtn.Position = UDim2.new(1, -34, 0, 6)
  313. RotateBtn.Parent = PreviewContainer
  314.  
  315. local AutoRotate = false
  316.  
  317. RotateBtn.MouseButton1Click:Connect(function()
  318.     AutoRotate = not AutoRotate
  319.     RotateBtn.Text = AutoRotate and "⏸" or "🔁"
  320. end)
  321.  
  322. local ResizeHandle = New("Frame", {
  323.     Name = "ResizeHandle",
  324.     Size = UDim2.new(0, 16, 0, 16),
  325.     AnchorPoint = Vector2.new(1, 1),
  326.     Position = UDim2.new(1, 0, 1, 0),
  327.     BackgroundColor3 = Color3.fromRGB(180, 180, 180),
  328.     BackgroundTransparency = 0.3,
  329.     BorderSizePixel = 0,
  330.     Parent = Root
  331. })
  332. New("UICorner", { CornerRadius = UDim.new(0, 3), Parent = ResizeHandle })
  333.  
  334. local resizing = false
  335. local resizeStartPos = nil
  336. local resizeStartSize = nil
  337.  
  338. ResizeHandle.InputBegan:Connect(function(input)
  339.     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  340.         resizing = true
  341.         resizeStartPos = UserInputService:GetMouseLocation()
  342.         resizeStartSize = Root.Size
  343.     end
  344. end)
  345.  
  346. UserInputService.InputEnded:Connect(function(input)
  347.     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  348.         resizing = false
  349.     end
  350. end)
  351.  
  352. UserInputService.InputChanged:Connect(function(input)
  353.     if resizing and input.UserInputType == Enum.UserInputType.MouseMovement then
  354.         local delta = UserInputService:GetMouseLocation() - resizeStartPos
  355.         Root.Size = UDim2.new(
  356.             resizeStartSize.X.Scale, math.max(600, resizeStartSize.X.Offset + delta.X),
  357.             resizeStartSize.Y.Scale, math.max(380, resizeStartSize.Y.Offset + delta.Y)
  358.         )
  359.     end
  360. end)
  361.  
  362. local MenuPanel = New("Frame", {
  363.     Name = "MenuPanel",
  364.     BackgroundColor3 = Color3.fromRGB(16, 16, 16),
  365.     BackgroundTransparency = 0.15,
  366.     BorderSizePixel = 0,
  367.     AnchorPoint = Vector2.new(0, 1),
  368.     Position = UDim2.new(0, 6, 1, -6),
  369.     Size = UDim2.new(1, -12, 0.48, -6),
  370.     Active = true,
  371.     Parent = RightPane
  372. })
  373.  
  374. local MenuScroll = New("ScrollingFrame", {
  375.     Name = "MenuScroll",
  376.     BackgroundTransparency = 1,
  377.     Size = UDim2.new(1, 0, 1, 0),
  378.     ScrollBarThickness = 8,
  379.     ScrollingDirection = Enum.ScrollingDirection.Y,
  380.     CanvasSize = UDim2.new(0, 0, 0, 0),
  381.     Parent = MenuPanel
  382. })
  383.  
  384. local MenuGrid = New("UIGridLayout", {
  385.     CellSize = UDim2.new(0, 150, 0, 36),
  386.     CellPadding = UDim2.new(0, 6, 0, 6),
  387.     FillDirection = Enum.FillDirection.Horizontal,
  388.     SortOrder = Enum.SortOrder.LayoutOrder,
  389.     Parent = MenuScroll
  390. })
  391.  
  392. MenuGrid:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  393.     MenuScroll.CanvasSize = UDim2.new(0, 0, 0, MenuGrid.AbsoluteContentSize.Y + 12)
  394. end)
  395.  
  396. local PlayBtn = MakeButton("Play")
  397. PlayBtn.Parent = MenuScroll
  398.  
  399. local StopBtn = MakeButton("Stop")
  400. StopBtn.Parent = MenuScroll
  401.  
  402. local ResumeBtn = MakeButton("Resume")
  403. ResumeBtn.Parent = MenuScroll
  404.  
  405. local FreezeBtn = MakeButton("Freeze")
  406. FreezeBtn.Parent = MenuScroll
  407.  
  408. local UnfreezeBtn = MakeButton("Unfreeze")
  409. UnfreezeBtn.Parent = MenuScroll
  410.  
  411. local SpeedSlider, SpeedGet, SpeedSet = MakeSlider("Speed", 0.1, 5.0, 1.0, 306)
  412. SpeedSlider.Parent = MenuScroll
  413.  
  414. local WeightSlider, WeightGet, WeightSet = MakeSlider("Weight", 0, 1, 1, 306)
  415. WeightSlider.Parent = MenuScroll
  416.  
  417. local BlendSlider, BlendGet, BlendSet = MakeSlider("Blend", 0, 1, 0.5, 306)
  418. BlendSlider.Parent = MenuScroll
  419.  
  420. local PlayCFrameBtn = MakeButton("Play CFrame")
  421. PlayCFrameBtn.Parent = MenuScroll
  422.  
  423. local StopCFrameBtn = MakeButton("Stop CFrame")
  424. StopCFrameBtn.Parent = MenuScroll
  425.  
  426. local ResumeCFrameBtn = MakeButton("Resume CFrame")
  427. ResumeCFrameBtn.Parent = MenuScroll
  428.  
  429. local SyncToggleBtn = MakeButton("Sync Preview: OFF")
  430. SyncToggleBtn.Parent = MenuScroll
  431.  
  432. local ModeToggleBtn = MakeButton("Mode: Preview")
  433. ModeToggleBtn.Parent = MenuScroll
  434.  
  435. local QuickPlayBtn = MakeButton("Quick Play Latest")
  436. QuickPlayBtn.Parent = MenuScroll
  437.  
  438. local QuickCFrameBtn = MakeButton("Quick CFrame Latest")
  439. QuickCFrameBtn.Parent = MenuScroll
  440.  
  441. local SaveTableBtn = MakeButton("Save Table")
  442. SaveTableBtn.Parent = MenuScroll
  443.  
  444. local SaveAllBtn = MakeButton("Save All")
  445. SaveAllBtn.Parent = MenuScroll
  446.  
  447. local ClearListBtn = MakeButton("Clear List")
  448. ClearListBtn.Parent = MenuScroll
  449.  
  450. local CopyIdBtn = MakeButton("Copy ID")
  451. CopyIdBtn.Parent = MenuScroll
  452.  
  453. local InjectBtn = MakeButton("Inject Manual")
  454. InjectBtn.Parent = MenuScroll
  455.  
  456. local AlignBtn = MakeButton("Align Preview")
  457. AlignBtn.Parent = MenuScroll
  458.  
  459. local ReloadBtn = MakeButton("Reload Preview")
  460. ReloadBtn.Parent = MenuScroll
  461.  
  462. local BatchSaveBtn = MakeButton("Batch Save")
  463. BatchSaveBtn.Parent = MenuScroll
  464.  
  465. local DedupToggleBtn = MakeButton("Dedup: OFF")
  466. DedupToggleBtn.Parent = MenuScroll
  467.  
  468. local TablePlayBtn = MakeButton("Play Table")
  469. TablePlayBtn.Parent = MenuScroll
  470.  
  471. local TableLoadBtn = MakeButton("Load Table")
  472. TableLoadBtn.Parent = MenuScroll
  473.  
  474. local function EnsureFolder(name)
  475.     if isfolder and not isfolder(name) then
  476.         if makefolder then
  477.             makefolder(name)
  478.         end
  479.     end
  480. end
  481.  
  482. local function normalizeId(input)
  483.     if typeof(input) == "number" then
  484.         return "rbxassetid://" .. tostring(input)
  485.     end
  486.     if typeof(input) == "string" then
  487.         local num = input:match("%d+")
  488.         if num then
  489.             return "rbxassetid://" .. num
  490.         end
  491.     end
  492.     return nil
  493. end
  494.  
  495. local function GetObject(input)
  496.     local assetId = normalizeId(input)
  497.     if not assetId then
  498.         return nil
  499.     end
  500.     local ok, obj = pcall(function()
  501.         return game:GetObjects(assetId)[1]
  502.     end)
  503.     if not ok or not obj then
  504.         return nil
  505.     end
  506.     if obj:IsA("KeyframeSequence") then
  507.         local kfs = obj:GetKeyframes()
  508.         table.sort(kfs, function(a, b)
  509.             return a.Time < b.Time
  510.         end)
  511.         local frames = {}
  512.         for _, kf in ipairs(kfs) do
  513.             local data = {}
  514.             for _, pose in ipairs(kf:GetDescendants()) do
  515.                 if pose:IsA("Pose") then
  516.                     data[pose.Name] = pose.CFrame
  517.                 end
  518.             end
  519.             table.insert(frames, { Time = kf.Time, Data = data })
  520.         end
  521.         return frames
  522.     end
  523.     return nil
  524. end
  525.  
  526. local function ExportFrames(frames, id, animName)
  527.     EnsureFolder("AnimExports")
  528.     local key = animName or tostring(id):match("%d+") or "Animation"
  529.     local s = "return {\n"
  530.     s = s .. "  [\"" .. key .. "\"] = {\n"
  531.     for _, f in ipairs(frames) do
  532.         s = s .. "    { Time = " .. string.format("%.3f", f.Time) .. ", Data = {\n"
  533.         for part, cf in pairs(f.Data) do
  534.             local c = { cf:GetComponents() }
  535.             s = s .. "      [\"" .. part .. "\"] = CFrame.new(" .. table.concat(c, ", ") .. "),\n"
  536.         end
  537.         s = s .. "    }},\n"
  538.     end
  539.     s = s .. "  }\n"
  540.     s = s .. "}"
  541.     local file = tostring(id):match("%d+")
  542.     if file and writefile then
  543.         local path = "AnimExports/" .. file .. ".lua"
  544.         if isfile and isfile(path) and delfile then
  545.             delfile(path)
  546.         end
  547.         writefile(path, s)
  548.     end
  549. end
  550.  
  551. local Blacklist = {
  552.     ["507766666"] = true,
  553.     ["507766951"] = true,
  554.     ["507767714"] = true,
  555.     ["507767968"] = true,
  556.     ["507768375"] = true,
  557.     ["507768133"] = true,
  558.     ["507767999"] = true,
  559.     ["507766388"] = true,
  560.     ["507771019"] = true,
  561.     ["507771955"] = true
  562. }
  563.  
  564. local LocalPlayer = Players.LocalPlayer
  565. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  566. local Humanoid = Character:FindFirstChildOfClass("Humanoid") or Character:WaitForChild("Humanoid")
  567.  
  568. local RotY = 0
  569. local RotX = -0.2
  570. local Dist = 14
  571.  
  572. local PreviewModel = nil
  573. local PreviewHumanoid = nil
  574. local PreviewAnimator = nil
  575.  
  576. local PreviewTrack = nil
  577. local ActiveCharTrack = nil
  578.  
  579. local UseCharacter = false
  580. local SyncEnabled = false
  581. local DedupEnabled = false
  582.  
  583. local function BuildPreview()
  584.     if PreviewModel then
  585.         PreviewModel:Destroy()
  586.     end
  587.     PreviewModel = Instance.new("Model")
  588.     PreviewModel.Name = "PreviewModel"
  589.     PreviewModel.Parent = Viewport
  590.     for _, d in ipairs(Character:GetDescendants()) do
  591.         if d:IsA("BasePart") or d:IsA("MeshPart") or d:IsA("Motor6D") or d:IsA("Humanoid") then
  592.             local c = d:Clone()
  593.             c.Parent = PreviewModel
  594.         end
  595.     end
  596.     local hrp = PreviewModel:FindFirstChild("HumanoidRootPart") or PreviewModel:FindFirstChildWhichIsA("BasePart")
  597.     if hrp then
  598.         PreviewModel.PrimaryPart = hrp
  599.     end
  600.     if PreviewModel.PrimaryPart then
  601.         PreviewModel:SetPrimaryPartCFrame(CFrame.new(0, 6, 0))
  602.     end
  603.     PreviewHumanoid = PreviewModel:FindFirstChildOfClass("Humanoid")
  604.     if PreviewHumanoid then
  605.         PreviewAnimator = PreviewHumanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", PreviewHumanoid)
  606.     else
  607.         local controller = Instance.new("AnimationController")
  608.         controller.Parent = PreviewModel
  609.         PreviewAnimator = Instance.new("Animator")
  610.         PreviewAnimator.Parent = controller
  611.     end
  612. end
  613.  
  614. BuildPreview()
  615.  
  616. local function IsOver(gui)
  617.     local mp = UserInputService:GetMouseLocation()
  618.     local abs = gui.AbsolutePosition
  619.     local size = gui.AbsoluteSize
  620.     return mp.X >= abs.X and mp.X <= abs.X + size.X and mp.Y >= abs.Y and mp.Y <= abs.Y + size.Y
  621. end
  622.  
  623. Viewport.InputBegan:Connect(function(i)
  624.     if i.UserInputType == Enum.UserInputType.MouseButton1 then
  625.         Viewport:SetAttribute("DragCam", true)
  626.         Viewport:SetAttribute("CamStart", i.Position)
  627.     elseif i.UserInputType == Enum.UserInputType.MouseWheel then
  628.         Dist = Dist - i.Position.Z * 2
  629.     end
  630. end)
  631.  
  632. Viewport.InputEnded:Connect(function(i)
  633.     if i.UserInputType == Enum.UserInputType.MouseButton1 then
  634.         Viewport:SetAttribute("DragCam", false)
  635.     end
  636. end)
  637.  
  638. Viewport.InputChanged:Connect(function(i)
  639.     if i.UserInputType ~= Enum.UserInputType.MouseMovement then
  640.         return
  641.     end
  642.     if Viewport:GetAttribute("DragCam") then
  643.         local last = Viewport:GetAttribute("CamStart") or i.Position
  644.         local d = i.Position - last
  645.         Viewport:SetAttribute("CamStart", i.Position)
  646.         RotY = RotY - d.X * 0.005
  647.         RotX = RotX - d.Y * 0.005
  648.     end
  649. end)
  650.  
  651. RunService.RenderStepped:Connect(function(dt)
  652.     if AutoRotate then
  653.         RotY = RotY + dt * 0.5
  654.     end
  655.     if PreviewModel and PreviewModel.PrimaryPart then
  656.         local center = PreviewModel.PrimaryPart.Position
  657.         local rotation = CFrame.Angles(0, RotY, 0) * CFrame.Angles(RotX, 0, 0)
  658.         local camCF = CFrame.new(center) * rotation * CFrame.new(0, 0, Dist)
  659.         Camera.CFrame = CFrame.lookAt(camCF.Position, center + Vector3.new(0, 2, 0))
  660.     end
  661. end)
  662.  
  663. local function ResetMotorsModel(model)
  664.     for _, m in ipairs(model:GetDescendants()) do
  665.         if m:IsA("Motor6D") then
  666.             m.Transform = CFrame.new()
  667.         end
  668.     end
  669. end
  670.  
  671. ModeToggleBtn.MouseButton1Click:Connect(function()
  672.     UseCharacter = not UseCharacter
  673.     ModeToggleBtn.Text = UseCharacter and "Mode: Character" or "Mode: Preview"
  674. end)
  675.  
  676. SyncToggleBtn.MouseButton1Click:Connect(function()
  677.     SyncEnabled = not SyncEnabled
  678.     SyncToggleBtn.Text = SyncEnabled and "Sync Preview: ON" or "Sync Preview: OFF"
  679.     BuildPreview()
  680.     ResetMotorsModel(PreviewModel)
  681. end)
  682.  
  683. DedupToggleBtn.MouseButton1Click:Connect(function()
  684.     DedupEnabled = not DedupEnabled
  685.     DedupToggleBtn.Text = DedupEnabled and "Dedup: ON" or "Dedup: OFF"
  686. end)
  687.  
  688. RunService.RenderStepped:Connect(function()
  689.     if not SyncEnabled then
  690.         return
  691.     end
  692.     if not Character or not PreviewModel then
  693.         return
  694.     end
  695.     local src = {}
  696.     for _, p in ipairs(Character:GetDescendants()) do
  697.         if p:IsA("Motor6D") then
  698.             src[p.Part1 and p.Part1.Name or p.Name] = p
  699.         end
  700.     end
  701.     local dst = {}
  702.     for _, m in ipairs(PreviewModel:GetDescendants()) do
  703.         if m:IsA("Motor6D") then
  704.             dst[m.Part1 and m.Part1.Name or m.Name] = m
  705.         end
  706.     end
  707.     for name, dm in pairs(dst) do
  708.         local sm = src[name]
  709.         if sm then
  710.             dm.Transform = sm.Transform
  711.         end
  712.     end
  713. end)
  714.  
  715. local function PlayIdSmart(id)
  716.     local s = normalizeId(id)
  717.     if not s then
  718.         return
  719.     end
  720.     if UseCharacter then
  721.         if Humanoid then
  722.             if ActiveCharTrack then
  723.                 ActiveCharTrack:Stop()
  724.                 ActiveCharTrack = nil
  725.             end
  726.             local anim = Instance.new("Animation")
  727.             anim.AnimationId = s
  728.             local track = Humanoid:LoadAnimation(anim)
  729.             ActiveCharTrack = track
  730.             track:Play()
  731.             track:AdjustSpeed(SpeedGet())
  732.             track:AdjustWeight(WeightGet())
  733.         end
  734.     else
  735.         if PreviewAnimator then
  736.             if PreviewTrack then
  737.                 PreviewTrack:Stop()
  738.                 PreviewTrack = nil
  739.             end
  740.             local anim = Instance.new("Animation")
  741.             anim.AnimationId = s
  742.             PreviewTrack = PreviewAnimator:LoadAnimation(anim)
  743.             PreviewTrack:Play()
  744.             PreviewTrack:AdjustSpeed(SpeedGet())
  745.             PreviewTrack:AdjustWeight(WeightGet())
  746.         end
  747.     end
  748. end
  749.  
  750. local ActiveCharCFrameConn = nil
  751. local ActivePreviewCFrameConn = nil
  752. local CFrameFrames = nil
  753. local CFramePlaying = false
  754. local CFrameLoop = true
  755. local CFrameSpeed = 1
  756.  
  757. local function stopCFrameAll()
  758.     CFramePlaying = false
  759.     if ActiveCharCFrameConn then
  760.         ActiveCharCFrameConn:Disconnect()
  761.         ActiveCharCFrameConn = nil
  762.     end
  763.     if ActivePreviewCFrameConn then
  764.         ActivePreviewCFrameConn:Disconnect()
  765.         ActivePreviewCFrameConn = nil
  766.     end
  767. end
  768.  
  769. local function StopAll()
  770.     stopCFrameAll()
  771.     if PreviewTrack then
  772.         PreviewTrack:Stop()
  773.         PreviewTrack = nil
  774.     end
  775.     if ActiveCharTrack then
  776.         ActiveCharTrack:Stop()
  777.         ActiveCharTrack = nil
  778.     end
  779.     ResetMotorsModel(UseCharacter and Character or PreviewModel)
  780. end
  781.  
  782. local function playCFrameOnModel(model, frames, speed, loop, blend)
  783.     local map = {}
  784.     for _, m in ipairs(model:GetDescendants()) do
  785.         if m:IsA("Motor6D") and m.Part1 then
  786.             map[m.Part1.Name] = m
  787.         end
  788.     end
  789.     local idx = 1
  790.     local timer = 0
  791.     local playing = true
  792.     local conn
  793.     conn = RunService.RenderStepped:Connect(function(dt)
  794.         if not playing then
  795.             conn:Disconnect()
  796.             return
  797.         end
  798.         timer = timer + dt * (speed or 1)
  799.         local a = frames[idx]
  800.         local b = frames[idx + 1]
  801.         if not a then
  802.             return
  803.         end
  804.         local t = a.Time
  805.         local nt = b and b.Time or a.Time
  806.         local span = math.max(nt - t, 1e-6)
  807.         local alpha = math.clamp((timer - t) / span, 0, 1)
  808.         local blended = {}
  809.         for k, v in pairs(a.Data) do
  810.             local vb = b and b.Data[k] or v
  811.             blended[k] = v:Lerp(vb, alpha)
  812.         end
  813.         for n, cf in pairs(blended) do
  814.             local j = map[n]
  815.             if j then
  816.                 j.Transform = (blend and blend < 1) and j.Transform:Lerp(cf, blend) or cf
  817.             end
  818.         end
  819.         if timer >= nt then
  820.             idx = idx + 1
  821.             if idx >= #frames then
  822.                 if loop then
  823.                     idx = 1
  824.                     timer = 0
  825.                 else
  826.                     playing = false
  827.                     conn:Disconnect()
  828.                 end
  829.             end
  830.         end
  831.     end)
  832.     return conn
  833. end
  834.  
  835. local function PlayCFrameSmart(idOrFrames, loop)
  836.     stopCFrameAll()
  837.     local frames = typeof(idOrFrames) == "table" and idOrFrames or GetObject(idOrFrames)
  838.     if not frames then
  839.         return
  840.     end
  841.     if DedupEnabled then
  842.         local result = {}
  843.         local last = nil
  844.         for i = 1, #frames do
  845.             local f = frames[i]
  846.             if not last then
  847.                 table.insert(result, f)
  848.                 last = f
  849.             else
  850.                 local changed = false
  851.                 for name, cf in pairs(f.Data) do
  852.                     local prev = last.Data[name]
  853.                     if not prev then
  854.                         changed = true
  855.                         break
  856.                     end
  857.                     local dp = (cf.Position - prev.Position).Magnitude
  858.                     local ax, ay, az = cf:ToOrientation()
  859.                     local bx, by, bz = prev:ToOrientation()
  860.                     local dr = math.abs(ax - bx) + math.abs(ay - by) + math.abs(az - bz)
  861.                     if dp > 1e-5 or dr > 1e-5 then
  862.                         changed = true
  863.                         break
  864.                     end
  865.                 end
  866.                 if changed then
  867.                     table.insert(result, f)
  868.                     last = f
  869.                 end
  870.             end
  871.         end
  872.         frames = result
  873.     end
  874.     if UseCharacter then
  875.         ResetMotorsModel(Character)
  876.         ActiveCharCFrameConn = playCFrameOnModel(Character, frames, CFrameSpeed, loop ~= false, BlendGet())
  877.     else
  878.         ResetMotorsModel(PreviewModel)
  879.         ActivePreviewCFrameConn = playCFrameOnModel(PreviewModel, frames, CFrameSpeed, loop ~= false, BlendGet())
  880.     end
  881.     CFrameFrames = frames
  882.     CFramePlaying = true
  883. end
  884.  
  885. local function LatestId()
  886.     local last = nil
  887.     local children = AnimLogger:GetChildren()
  888.     for i = #children, 1, -1 do
  889.         local c = children[i]
  890.         if c:IsA("TextButton") then
  891.             last = c
  892.             break
  893.         end
  894.     end
  895.     if not last then
  896.         return nil
  897.     end
  898.     local id = last.Text:match("rbxassetid://%d+") or last.Text:match("%d+")
  899.     return id
  900. end
  901.  
  902. PlayBtn.MouseButton1Click:Connect(function()
  903.     local id = AnimIdInput.Text
  904.     stopCFrameAll()
  905.     ResetMotorsModel(UseCharacter and Character or PreviewModel)
  906.     PlayIdSmart(id)
  907. end)
  908.  
  909. StopBtn.MouseButton1Click:Connect(function()
  910.     StopAll()
  911. end)
  912.  
  913. ResumeBtn.MouseButton1Click:Connect(function()
  914.     local id = AnimIdInput.Text
  915.     if UseCharacter then
  916.         PlayIdSmart(id)
  917.     else
  918.         if PreviewTrack then
  919.             PreviewTrack:AdjustSpeed(SpeedGet())
  920.             PreviewTrack:Play()
  921.         else
  922.             PlayIdSmart(id)
  923.         end
  924.     end
  925. end)
  926.  
  927. FreezeBtn.MouseButton1Click:Connect(function()
  928.     if PreviewTrack then
  929.         PreviewTrack:AdjustSpeed(0)
  930.     end
  931.     if ActiveCharTrack then
  932.         ActiveCharTrack:AdjustSpeed(0)
  933.     end
  934.     CFramePlaying = false
  935. end)
  936.  
  937. UnfreezeBtn.MouseButton1Click:Connect(function()
  938.     if PreviewTrack then
  939.         PreviewTrack:AdjustSpeed(SpeedGet())
  940.     end
  941.     if ActiveCharTrack then
  942.         ActiveCharTrack:AdjustSpeed(SpeedGet())
  943.     end
  944.     if CFrameFrames and #CFrameFrames > 0 then
  945.         CFramePlaying = true
  946.     end
  947. end)
  948.  
  949. PlayCFrameBtn.MouseButton1Click:Connect(function()
  950.     local id = AnimIdInput.Text
  951.     local frames = GetObject(id)
  952.     if frames and #frames > 0 then
  953.         CFrameSpeed = math.max(0.05, math.min(10, SpeedGet()))
  954.         PlayCFrameSmart(frames, true)
  955.     else
  956.         stopCFrameAll()
  957.         ResetMotorsModel(UseCharacter and Character or PreviewModel)
  958.         PlayIdSmart(id)
  959.         task.delay(0.1, function()
  960.             local live = {}
  961.             local motors = {}
  962.             for _, m in ipairs((UseCharacter and Character or PreviewModel):GetDescendants()) do
  963.                 if m:IsA("Motor6D") and m.Part1 then
  964.                     motors[m.Part1.Name] = m
  965.                 end
  966.             end
  967.             local start = tick()
  968.             local conn = RunService.Heartbeat:Connect(function()
  969.                 local elapsed = tick() - start
  970.                 local data = {}
  971.                 for name, mot in pairs(motors) do
  972.                     data[name] = mot.Transform
  973.                 end
  974.                 table.insert(live, { Time = elapsed, Data = data })
  975.                 if elapsed >= 8 then
  976.                     conn:Disconnect()
  977.                 end
  978.             end)
  979.             task.delay(8.1, function()
  980.                 if #live > 0 then
  981.                     CFrameSpeed = math.max(0.05, math.min(10, SpeedGet()))
  982.                     PlayCFrameSmart(live, true)
  983.                 end
  984.             end)
  985.         end)
  986.     end
  987. end)
  988.  
  989. StopCFrameBtn.MouseButton1Click:Connect(function()
  990.     stopCFrameAll()
  991. end)
  992.  
  993. ResumeCFrameBtn.MouseButton1Click:Connect(function()
  994.     if CFrameFrames and #CFrameFrames > 0 then
  995.         CFrameSpeed = math.max(0.05, math.min(10, SpeedGet()))
  996.         PlayCFrameSmart(CFrameFrames, CFrameLoop)
  997.     end
  998. end)
  999.  
  1000. local SliderWatcher = Instance.new("BindableEvent")
  1001. SliderWatcher.Event:Connect(function()
  1002.     local s = SpeedGet()
  1003.     local w = WeightGet()
  1004.     if PreviewTrack then
  1005.         PreviewTrack:AdjustSpeed(s)
  1006.         PreviewTrack:AdjustWeight(w)
  1007.     end
  1008.     if ActiveCharTrack then
  1009.         ActiveCharTrack:AdjustSpeed(s)
  1010.         ActiveCharTrack:AdjustWeight(w)
  1011.     end
  1012.     CFrameSpeed = math.max(0.05, math.min(10, s))
  1013. end)
  1014.  
  1015. SpeedSlider.InputChanged:Connect(function()
  1016.     SliderWatcher:Fire()
  1017. end)
  1018.  
  1019. WeightSlider.InputChanged:Connect(function()
  1020.     SliderWatcher:Fire()
  1021. end)
  1022.  
  1023. BlendSlider.InputChanged:Connect(function()
  1024.     SliderWatcher:Fire()
  1025. end)
  1026.  
  1027. CopyIdBtn.MouseButton1Click:Connect(function()
  1028.     local id = normalizeId(AnimIdInput.Text) or AnimIdInput.Text
  1029.     if setclipboard then
  1030.         setclipboard(tostring(id))
  1031.     end
  1032. end)
  1033.  
  1034. InjectBtn.MouseButton1Click:Connect(function()
  1035.     local id = AnimIdInput.Text
  1036.     local nid = normalizeId(id) or id
  1037.     local item = MakeButton("Manual\n" .. nid, UDim2.new(1, -8, 0, 48))
  1038.     item.Parent = AnimLogger
  1039.     item.MouseButton1Click:Connect(function()
  1040.         if setclipboard then
  1041.             setclipboard(tostring(nid))
  1042.         end
  1043.         stopCFrameAll()
  1044.         ResetMotorsModel(UseCharacter and Character or PreviewModel)
  1045.         PlayIdSmart(id)
  1046.     end)
  1047.     AnimLogger.CanvasSize = UDim2.new(0, 0, 0, AnimLoggerLayout.AbsoluteContentSize.Y + 12)
  1048. end)
  1049.  
  1050. AlignBtn.MouseButton1Click:Connect(function()
  1051.     if PreviewModel and PreviewModel.PrimaryPart then
  1052.         PreviewModel:SetPrimaryPartCFrame(CFrame.new(0, 6, 0))
  1053.     end
  1054. end)
  1055.  
  1056. ReloadBtn.MouseButton1Click:Connect(function()
  1057.     stopCFrameAll()
  1058.     if PreviewTrack then
  1059.         PreviewTrack:Stop()
  1060.         PreviewTrack = nil
  1061.     end
  1062.     BuildPreview()
  1063.     ResetMotorsModel(UseCharacter and Character or PreviewModel)
  1064. end)
  1065.  
  1066. QuickPlayBtn.MouseButton1Click:Connect(function()
  1067.     local id = LatestId()
  1068.     if id then
  1069.         stopCFrameAll()
  1070.         ResetMotorsModel(UseCharacter and Character or PreviewModel)
  1071.         PlayIdSmart(id)
  1072.     end
  1073. end)
  1074.  
  1075. QuickCFrameBtn.MouseButton1Click:Connect(function()
  1076.     local id = LatestId()
  1077.     if id then
  1078.         local frames = GetObject(id)
  1079.         if frames and #frames > 0 then
  1080.             CFrameSpeed = math.max(0.05, math.min(10, SpeedGet()))
  1081.             PlayCFrameSmart(frames, true)
  1082.         else
  1083.             stopCFrameAll()
  1084.             ResetMotorsModel(UseCharacter and Character or PreviewModel)
  1085.             PlayIdSmart(id)
  1086.             task.delay(0.1, function()
  1087.                 local live = {}
  1088.                 local motors = {}
  1089.                 for _, m in ipairs((UseCharacter and Character or PreviewModel):GetDescendants()) do
  1090.                     if m:IsA("Motor6D") and m.Part1 then
  1091.                         motors[m.Part1.Name] = m
  1092.                     end
  1093.                 end
  1094.                 local start = tick()
  1095.                 local conn = RunService.Heartbeat:Connect(function()
  1096.                     local elapsed = tick() - start
  1097.                     local data = {}
  1098.                     for name, mot in pairs(motors) do
  1099.                         data[name] = mot.Transform
  1100.                     end
  1101.                     table.insert(live, { Time = elapsed, Data = data })
  1102.                     if elapsed >= 8 then
  1103.                         conn:Disconnect()
  1104.                     end
  1105.                 end)
  1106.                 task.delay(8.1, function()
  1107.                     if #live > 0 then
  1108.                         CFrameSpeed = math.max(0.05, math.min(10, SpeedGet()))
  1109.                         PlayCFrameSmart(live, true)
  1110.                     end
  1111.                 end)
  1112.             end)
  1113.         end
  1114.     end
  1115. end)
  1116.  
  1117. SaveTableBtn.MouseButton1Click:Connect(function()
  1118.     local id = AnimIdInput.Text
  1119.     local nid = tostring(id):match("%d+")
  1120.     if not nid or Blacklist[nid] then
  1121.         return
  1122.     end
  1123.     local frames = GetObject(id)
  1124.     if frames and #frames > 0 then
  1125.         ExportFrames(frames, id, AnimIdInput.Text ~= "" and AnimIdInput.Text or nil)
  1126.     end
  1127. end)
  1128.  
  1129. SaveAllBtn.MouseButton1Click:Connect(function()
  1130.     for _, child in ipairs(AnimLogger:GetChildren()) do
  1131.         if child:IsA("TextButton") then
  1132.             local id = child.Text:match("rbxassetid://(%d+)")
  1133.             if id and not Blacklist[id] then
  1134.                 local frames = GetObject(id)
  1135.                 if frames and #frames > 0 then
  1136.                     ExportFrames(frames, id, child.Text:match("^(.-)\n") or nil)
  1137.                 end
  1138.             end
  1139.         end
  1140.     end
  1141. end)
  1142.  
  1143. BatchSaveBtn.MouseButton1Click:Connect(function()
  1144.     local raw = AnimIdInput.Text
  1145.     local list = {}
  1146.     for num in tostring(raw):gmatch("%d+") do
  1147.         table.insert(list, num)
  1148.     end
  1149.     for _, id in ipairs(list) do
  1150.         if not Blacklist[id] then
  1151.             local frames = GetObject(id)
  1152.             if frames and #frames > 0 then
  1153.                 ExportFrames(frames, id, tostring(id))
  1154.             end
  1155.         end
  1156.     end
  1157. end)
  1158.  
  1159. TableLoadBtn.MouseButton1Click:Connect(function()
  1160.     local id = AnimIdInput.Text
  1161.     local file = tostring(id):match("%d+")
  1162.     if file and readfile and isfile and isfile("AnimExports/" .. file .. ".lua") then
  1163.         local ok, tbl = pcall(function()
  1164.             return loadstring(readfile("AnimExports/" .. file .. ".lua"))()
  1165.         end)
  1166.         if ok and typeof(tbl) == "table" then
  1167.             for _, v in pairs(tbl) do
  1168.                 if typeof(v) == "table" and #v > 0 then
  1169.                     CFrameFrames = v
  1170.                     break
  1171.                 end
  1172.             end
  1173.         end
  1174.     end
  1175. end)
  1176.  
  1177. TablePlayBtn.MouseButton1Click:Connect(function()
  1178.     if CFrameFrames and #CFrameFrames > 0 then
  1179.         CFrameSpeed = math.max(0.05, math.min(10, SpeedGet()))
  1180.         PlayCFrameSmart(CFrameFrames, true)
  1181.     end
  1182. end)
  1183.  
  1184. ClearListBtn.MouseButton1Click:Connect(function()
  1185.     for _, child in ipairs(AnimLogger:GetChildren()) do
  1186.         if child:IsA("TextButton") then
  1187.             child:Destroy()
  1188.         end
  1189.     end
  1190.     AnimLogger.CanvasSize = UDim2.new(0, 0, 0, 0)
  1191. end)
  1192.  
  1193. local Logged = {}
  1194.  
  1195. local function PassesFilter(name, id)
  1196.     local f = SearchBar.Text
  1197.     if f == nil or f == "" then
  1198.         return true
  1199.     end
  1200.     f = f:lower()
  1201.     local n = (name or ""):lower()
  1202.     local s = (id or ""):lower()
  1203.     return string.find(n, f, 1, true) or string.find(s, f, 1, true)
  1204. end
  1205.  
  1206. local function MakeLogItem(name, id)
  1207.     local btn = MakeButton(name .. "\n" .. id, UDim2.new(1, -8, 0, 48))
  1208.     btn.Parent = AnimLogger
  1209.     btn.MouseButton1Click:Connect(function()
  1210.         local nid = normalizeId(id) or id
  1211.         if setclipboard then
  1212.             setclipboard(nid)
  1213.         end
  1214.         stopCFrameAll()
  1215.         ResetMotorsModel(UseCharacter and Character or PreviewModel)
  1216.         PlayIdSmart(id)
  1217.     end)
  1218.     return btn
  1219. end
  1220.  
  1221. local function LogAnim(name, id)
  1222.     id = (id and tostring(id)) or ""
  1223.     if id == "" then
  1224.         return
  1225.     end
  1226.     local nid = normalizeId(id) or id
  1227.     if Logged[nid] then
  1228.         return
  1229.     end
  1230.     if not PassesFilter(name, nid) then
  1231.         return
  1232.     end
  1233.     Logged[nid] = true
  1234.     MakeLogItem(name ~= "" and name or "Unknown", nid)
  1235.     AnimLogger.CanvasSize = UDim2.new(0, 0, 0, AnimLoggerLayout.AbsoluteContentSize.Y + 12)
  1236. end
  1237.  
  1238. Humanoid.AnimationPlayed:Connect(function(track)
  1239.     local a = track and track.Animation
  1240.     LogAnim(a and a.Name or "Unknown", a and a.AnimationId or "")
  1241. end)
  1242.  
  1243. SearchBar:GetPropertyChangedSignal("Text"):Connect(function()
  1244.     for _, child in ipairs(AnimLogger:GetChildren()) do
  1245.         if child:IsA("TextButton") then
  1246.             child:Destroy()
  1247.         end
  1248.     end
  1249.     AnimLogger.CanvasSize = UDim2.new(0, 0, 0, 0)
  1250.     Logged = {}
  1251. end)
  1252.  
  1253. Players.LocalPlayer.CharacterAdded:Connect(function(c)
  1254.     Character = c
  1255.     Humanoid = Character:WaitForChild("Humanoid")
  1256.     BuildPreview()
  1257.     ResetMotorsModel(PreviewModel)
  1258. end)
  1259.  
  1260. CloseBtn.MouseButton1Click:Connect(function()
  1261.     StopAll()
  1262.     Gui:Destroy()
  1263. end)
Advertisement
Add Comment
Please, Sign In to add comment