Josiahiscool73

Animation Recorder

Jan 19th, 2026
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.11 KB | None | 0 0
  1. -- seems very bad and simple but what this does is it creates your character as a clone and lets you record animations in other games
  2. -- and lets you play those animations back onto a clone and yes its also ai made but took a while cuz ai cant code
  3.  
  4. local Players = game:GetService("Players")
  5. local RunService = game:GetService("RunService")
  6. local UserInputService = game:GetService("UserInputService")
  7. local HttpService = game:GetService("HttpService")
  8. local TweenService = game:GetService("TweenService")
  9.  
  10. local player = Players.LocalPlayer
  11. local character = player.Character or player.CharacterAdded:Wait()
  12. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  13.  
  14. local CLONE_DISTANCE = 5
  15. local RECORD_KEY = Enum.KeyCode.E
  16. local REPLAY_KEY = Enum.KeyCode.R
  17. local RESPAWN_KEY = Enum.KeyCode.T
  18. local FOLDER_NAME = "AnimTesting"
  19.  
  20. local myClone = nil
  21. local isRecording = false
  22. local recordedFrames = {}
  23. local recordConnection = nil
  24. local replayConnection = nil
  25. local isReplaying = false
  26. local isLooping = false
  27. local playerBodyParts = {}
  28. local cloneBodyParts = {}
  29. local dragging = false
  30. local dragInput = nil
  31. local dragStart = nil
  32. local startPos = nil
  33.  
  34. local bodyPartNames = {
  35. "Head", "HumanoidRootPart", "Left Arm", "Left Leg",
  36. "Right Arm", "Right Leg", "Torso"
  37. }
  38.  
  39. local FileSystem = {
  40. Enabled = (getgenv and (writefile or getgenv().writefile)) ~= nil,
  41. Write = writefile or (getgenv and getgenv().writefile),
  42. Read = readfile or (getgenv and getgenv().readfile),
  43. List = listfiles or (getgenv and getgenv().listfiles),
  44. IsFolder = isfolder or (getgenv and getgenv().isfolder),
  45. MakeFolder = makefolder or (getgenv and getgenv().makefolder)
  46. }
  47.  
  48. if FileSystem.Enabled then
  49. if not FileSystem.IsFolder(FOLDER_NAME) then
  50. FileSystem.MakeFolder(FOLDER_NAME)
  51. end
  52. end
  53.  
  54. local function createDummy()
  55. local dummy = Instance.new("Model")
  56. dummy.Name = "Clone"
  57.  
  58. local hrp = Instance.new("Part")
  59. hrp.Name = "HumanoidRootPart"
  60. hrp.Size = Vector3.new(2, 2, 1)
  61. hrp.Transparency = 1
  62. hrp.CanCollide = false
  63. hrp.Parent = dummy
  64.  
  65. local humanoid = Instance.new("Humanoid")
  66. humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  67. humanoid.Parent = dummy
  68.  
  69. local function createPart(name, size)
  70. local part = Instance.new("Part")
  71. part.Name = name
  72. part.Size = size
  73. part.TopSurface = Enum.SurfaceType.Smooth
  74. part.BottomSurface = Enum.SurfaceType.Smooth
  75. part.CanCollide = false
  76. part.Parent = dummy
  77. return part
  78. end
  79.  
  80. local head = createPart("Head", Vector3.new(2, 1, 1))
  81. local headMesh = Instance.new("SpecialMesh")
  82. headMesh.MeshType = Enum.MeshType.Head
  83. headMesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  84. headMesh.Parent = head
  85.  
  86. local torso = createPart("Torso", Vector3.new(2, 2, 1))
  87. local leftArm = createPart("Left Arm", Vector3.new(1, 2, 1))
  88. local rightArm = createPart("Right Arm", Vector3.new(1, 2, 1))
  89. local leftLeg = createPart("Left Leg", Vector3.new(1, 2, 1))
  90. local rightLeg = createPart("Right Leg", Vector3.new(1, 2, 1))
  91.  
  92. local function createMotor(name, part0, part1, c0, c1)
  93. local motor = Instance.new("Motor6D")
  94. motor.Name = name
  95. motor.Part0 = part0
  96. motor.Part1 = part1
  97. motor.C0 = c0
  98. motor.C1 = c1
  99. motor.Parent = part0
  100. return motor
  101. end
  102.  
  103. createMotor("Neck", torso, head, CFrame.new(0, 1, 0), CFrame.new(0, -0.5, 0))
  104. createMotor("Left Shoulder", torso, leftArm, CFrame.new(-1, 0.5, 0), CFrame.new(0.5, 0.5, 0))
  105. createMotor("Right Shoulder", torso, rightArm, CFrame.new(1, 0.5, 0), CFrame.new(-0.5, 0.5, 0))
  106. createMotor("Left Hip", torso, leftLeg, CFrame.new(-0.5, -1, 0), CFrame.new(0, 1, 0))
  107. createMotor("Right Hip", torso, rightLeg, CFrame.new(0.5, -1, 0), CFrame.new(0, 1, 0))
  108. createMotor("Root Joint", hrp, torso, CFrame.new(0, 0, 0), CFrame.new(0, 0, 0))
  109.  
  110. local face = Instance.new("Decal")
  111. face.Name = "face"
  112. face.Texture = "rbxasset://textures/face.png"
  113. face.Parent = head
  114.  
  115. dummy.PrimaryPart = hrp
  116. return dummy
  117. end
  118.  
  119. local function spawnClone()
  120. if myClone then myClone:Destroy() end
  121. if not player.Character then return end
  122.  
  123. character = player.Character
  124. humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
  125. if not humanoidRootPart then return end
  126.  
  127. myClone = createDummy()
  128. local cloneRoot = myClone:FindFirstChild("HumanoidRootPart")
  129. if cloneRoot then
  130. cloneRoot.CFrame = humanoidRootPart.CFrame * CFrame.new(0, 0, -CLONE_DISTANCE)
  131. cloneRoot.CFrame = CFrame.lookAt(cloneRoot.Position, humanoidRootPart.Position)
  132. end
  133.  
  134. myClone.Parent = workspace
  135.  
  136. local hum = character:FindFirstChild("Humanoid")
  137. if hum then
  138. local success, desc = pcall(function() return hum:GetAppliedDescription() end)
  139. if success and desc then
  140. local cloneHumanoid = myClone:FindFirstChildOfClass("Humanoid")
  141. if cloneHumanoid then pcall(function() cloneHumanoid:ApplyDescription(desc) end) end
  142. end
  143. end
  144. end
  145.  
  146. local function serializeFrames(frames)
  147. local data = {}
  148. for i, frame in ipairs(frames) do
  149. data[i] = {}
  150. for partName, partData in pairs(frame) do
  151. data[i][partName] = {partData.CFrame:components()}
  152. end
  153. end
  154. return HttpService:JSONEncode(data)
  155. end
  156.  
  157. local function deserializeFrames(jsonString)
  158. local rawData = HttpService:JSONDecode(jsonString)
  159. local frames = {}
  160. for i, rawFrame in ipairs(rawData) do
  161. frames[i] = {}
  162. for partName, components in pairs(rawFrame) do
  163. frames[i][partName] = { CFrame = CFrame.new(unpack(components)) }
  164. end
  165. end
  166. return frames
  167. end
  168.  
  169. local function createModernGUI()
  170. local screenGui = Instance.new("ScreenGui")
  171. screenGui.Name = "AnimationTestingUI"
  172. screenGui.ResetOnSpawn = false
  173. screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  174. screenGui.Parent = player:WaitForChild("PlayerGui")
  175.  
  176. local mainFrame = Instance.new("Frame")
  177. mainFrame.Size = UDim2.new(0, 360, 0, 420)
  178. mainFrame.Position = UDim2.new(0.5, -180, 0, 50)
  179. mainFrame.BackgroundColor3 = Color3.fromRGB(25, 28, 33)
  180. mainFrame.BackgroundTransparency = 0.9
  181. mainFrame.BorderSizePixel = 0
  182. mainFrame.ClipsDescendants = true
  183. mainFrame.Parent = screenGui
  184.  
  185. local mainCorner = Instance.new("UICorner")
  186. mainCorner.CornerRadius = UDim.new(0, 8)
  187. mainCorner.Parent = mainFrame
  188.  
  189. local border = Instance.new("Frame")
  190. border.Size = UDim2.new(1, 0, 1, 0)
  191. border.BackgroundColor3 = Color3.fromRGB(60, 65, 75)
  192. border.BorderSizePixel = 1
  193. border.BorderColor3 = Color3.fromRGB(40, 45, 55)
  194. border.BackgroundTransparency = 0.75
  195. border.Parent = mainFrame
  196.  
  197. local borderCorner = Instance.new("UICorner")
  198. borderCorner.CornerRadius = UDim.new(0, 8)
  199. borderCorner.Parent = border
  200.  
  201. local titleBar = Instance.new("Frame")
  202. titleBar.Size = UDim2.new(1, 0, 0, 32)
  203. titleBar.BackgroundColor3 = Color3.fromRGB(35, 40, 48)
  204. titleBar.BackgroundTransparency = 0.8
  205. titleBar.BorderSizePixel = 0
  206. titleBar.Active = true
  207. titleBar.Parent = mainFrame
  208.  
  209. local titleBarCorner = Instance.new("UICorner")
  210. titleBarCorner.CornerRadius = UDim.new(0, 8)
  211. titleBarCorner.Parent = titleBar
  212.  
  213. local title = Instance.new("TextLabel")
  214. title.Size = UDim2.new(0, 200, 1, 0)
  215. title.Position = UDim2.new(0, 12, 0, 0)
  216. title.Text = "ANIMATION TESTING"
  217. title.TextColor3 = Color3.fromRGB(220, 220, 230)
  218. title.TextSize = 16
  219. title.Font = Enum.Font.GothamBold
  220. title.BackgroundTransparency = 1
  221. title.Parent = titleBar
  222.  
  223. local closeButton = Instance.new("TextButton")
  224. closeButton.Size = UDim2.new(0, 24, 0, 24)
  225. closeButton.Position = UDim2.new(1, -36, 0.5, -12)
  226. closeButton.Text = "×"
  227. closeButton.TextSize = 22
  228. closeButton.Font = Enum.Font.GothamBold
  229. closeButton.TextColor3 = Color3.fromRGB(200, 200, 220)
  230. closeButton.BackgroundColor3 = Color3.fromRGB(200, 70, 70)
  231. closeButton.BackgroundTransparency = 0.2
  232. closeButton.BorderSizePixel = 0
  233. closeButton.Parent = titleBar
  234.  
  235. local closeCorner = Instance.new("UICorner")
  236. closeCorner.CornerRadius = UDim.new(0, 6)
  237. closeCorner.Parent = closeButton
  238.  
  239. local statusFrame = Instance.new("Frame")
  240. statusFrame.Size = UDim2.new(1, -20, 0, 28)
  241. statusFrame.Position = UDim2.new(0, 10, 0, 40)
  242. statusFrame.BackgroundColor3 = Color3.fromRGB(40, 45, 55)
  243. statusFrame.BackgroundTransparency = 0.6
  244. statusFrame.BorderSizePixel = 0
  245. statusFrame.Parent = mainFrame
  246.  
  247. local statusCorner = Instance.new("UICorner")
  248. statusCorner.CornerRadius = UDim.new(0, 6)
  249. statusCorner.Parent = statusFrame
  250.  
  251. local statusLabel = Instance.new("TextLabel")
  252. statusLabel.Size = UDim2.new(1, -12, 1, -6)
  253. statusLabel.Position = UDim2.new(0, 6, 0, 3)
  254. statusLabel.Text = "Status: Idle"
  255. statusLabel.TextColor3 = Color3.fromRGB(180, 180, 200)
  256. statusLabel.TextSize = 14
  257. statusLabel.Font = Enum.Font.Gotham
  258. statusLabel.BackgroundTransparency = 1
  259. statusLabel.Parent = statusFrame
  260.  
  261. local keybindsFrame = Instance.new("Frame")
  262. keybindsFrame.Size = UDim2.new(1, -20, 0, 56)
  263. keybindsFrame.Position = UDim2.new(0, 10, 0, 72)
  264. keybindsFrame.BackgroundColor3 = Color3.fromRGB(40, 45, 55)
  265. keybindsFrame.BackgroundTransparency = 0.6
  266. keybindsFrame.BorderSizePixel = 0
  267. keybindsFrame.Parent = mainFrame
  268.  
  269. local keybindsCorner = Instance.new("UICorner")
  270. keybindsCorner.CornerRadius = UDim.new(0, 6)
  271. keybindsCorner.Parent = keybindsFrame
  272.  
  273. local keybindsTitle = Instance.new("TextLabel")
  274. keybindsTitle.Size = UDim2.new(1, -12, 0, 20)
  275. keybindsTitle.Position = UDim2.new(0, 6, 0, 4)
  276. keybindsTitle.Text = "CONTROLS"
  277. keybindsTitle.TextColor3 = Color3.fromRGB(160, 180, 220)
  278. keybindsTitle.TextSize = 14
  279. keybindsTitle.Font = Enum.Font.GothamBold
  280. keybindsTitle.BackgroundTransparency = 1
  281. keybindsTitle.Parent = keybindsFrame
  282.  
  283. local keybindsText = Instance.new("TextLabel")
  284. keybindsText.Size = UDim2.new(1, -12, 0, 30)
  285. keybindsText.Position = UDim2.new(0, 6, 0, 24)
  286. keybindsText.Text = string.format("Record: %s | Play: %s | Spawn: %s", RECORD_KEY.Name, REPLAY_KEY.Name, RESPAWN_KEY.Name)
  287. keybindsText.TextColor3 = Color3.fromRGB(200, 210, 230)
  288. keybindsText.TextSize = 13
  289. keybindsText.Font = Enum.Font.Gotham
  290. keybindsText.BackgroundTransparency = 1
  291. keybindsText.Parent = keybindsFrame
  292.  
  293. local loopToggle = Instance.new("TextButton")
  294. loopToggle.Size = UDim2.new(1, -20, 0, 30)
  295. loopToggle.Position = UDim2.new(0, 10, 0, 132)
  296. loopToggle.Text = "LOOP: OFF"
  297. loopToggle.TextColor3 = Color3.fromRGB(220, 220, 240)
  298. loopToggle.TextSize = 14
  299. loopToggle.Font = Enum.Font.GothamBold
  300. loopToggle.BackgroundColor3 = Color3.fromRGB(100, 60, 60)
  301. loopToggle.BackgroundTransparency = 0.4
  302. loopToggle.BorderSizePixel = 0
  303. loopToggle.Parent = mainFrame
  304.  
  305. local loopCorner = Instance.new("UICorner")
  306. loopCorner.CornerRadius = UDim.new(0, 6)
  307. loopCorner.Parent = loopToggle
  308.  
  309. local divider = Instance.new("Frame")
  310. divider.Size = UDim2.new(1, -20, 0, 1)
  311. divider.Position = UDim2.new(0, 10, 0, 166)
  312. divider.BackgroundColor3 = Color3.fromRGB(70, 80, 90)
  313. divider.BackgroundTransparency = 0.7
  314. divider.BorderSizePixel = 0
  315. divider.Parent = mainFrame
  316.  
  317. local saveFrame = Instance.new("Frame")
  318. saveFrame.Size = UDim2.new(1, -20, 0, 48)
  319. saveFrame.Position = UDim2.new(0, 10, 0, 172)
  320. saveFrame.BackgroundColor3 = Color3.fromRGB(40, 45, 55)
  321. saveFrame.BackgroundTransparency = 0.6
  322. saveFrame.BorderSizePixel = 0
  323. saveFrame.Parent = mainFrame
  324.  
  325. local saveCorner = Instance.new("UICorner")
  326. saveCorner.CornerRadius = UDim.new(0, 6)
  327. saveCorner.Parent = saveFrame
  328.  
  329. local nameLabel = Instance.new("TextLabel")
  330. nameLabel.Size = UDim2.new(1, -12, 0, 20)
  331. nameLabel.Position = UDim2.new(0, 6, 0, 4)
  332. nameLabel.Text = "ANIMATION NAME"
  333. nameLabel.TextColor3 = Color3.fromRGB(180, 190, 220)
  334. nameLabel.TextSize = 14
  335. nameLabel.Font = Enum.Font.Gotham
  336. nameLabel.BackgroundTransparency = 1
  337. nameLabel.Parent = saveFrame
  338.  
  339. local saveBox = Instance.new("TextBox")
  340. saveBox.Size = UDim2.new(0.7, -6, 0, 24)
  341. saveBox.Position = UDim2.new(0, 6, 0, 24)
  342. saveBox.BackgroundColor3 = Color3.fromRGB(50, 55, 65)
  343. saveBox.TextColor3 = Color3.fromRGB(220, 220, 240)
  344. saveBox.TextSize = 14
  345. saveBox.Font = Enum.Font.Gotham
  346. saveBox.PlaceholderColor3 = Color3.fromRGB(150, 160, 180)
  347. saveBox.PlaceholderText = "Enter animation name"
  348. saveBox.ClearTextOnFocus = false
  349. saveBox.BorderSizePixel = 0
  350. saveBox.Parent = saveFrame
  351.  
  352. local boxCorner = Instance.new("UICorner")
  353. boxCorner.CornerRadius = UDim.new(0, 4)
  354. boxCorner.Parent = saveBox
  355.  
  356. local saveBtn = Instance.new("TextButton")
  357. saveBtn.Size = UDim2.new(0.3, -6, 0, 24)
  358. saveBtn.Position = UDim2.new(0.7, 6, 0, 24)
  359. saveBtn.Text = "SAVE"
  360. saveBtn.TextColor3 = Color3.fromRGB(240, 240, 255)
  361. saveBtn.TextSize = 14
  362. saveBtn.Font = Enum.Font.GothamBold
  363. saveBtn.BackgroundColor3 = Color3.fromRGB(50, 140, 70)
  364. saveBtn.BackgroundTransparency = 0.3
  365. saveBtn.BorderSizePixel = 0
  366. saveBtn.Parent = saveFrame
  367.  
  368. local btnCorner = Instance.new("UICorner")
  369. btnCorner.CornerRadius = UDim.new(0, 4)
  370. btnCorner.Parent = saveBtn
  371.  
  372. local listBtn = Instance.new("TextButton")
  373. listBtn.Size = UDim2.new(1, -20, 0, 32)
  374. listBtn.Position = UDim2.new(0, 10, 0, 224)
  375. listBtn.Text = "📁 ANIMATION LIBRARY"
  376. listBtn.TextColor3 = Color3.fromRGB(220, 220, 240)
  377. listBtn.TextSize = 15
  378. listBtn.Font = Enum.Font.GothamBold
  379. listBtn.BackgroundColor3 = Color3.fromRGB(60, 100, 140)
  380. listBtn.BackgroundTransparency = 0.4
  381. listBtn.BorderSizePixel = 0
  382. listBtn.Parent = mainFrame
  383.  
  384. local listBtnCorner = Instance.new("UICorner")
  385. listBtnCorner.CornerRadius = UDim.new(0, 6)
  386. listBtnCorner.Parent = listBtn
  387.  
  388. local fileListFrame = Instance.new("Frame")
  389. fileListFrame.Size = UDim2.new(1, -20, 0, 110)
  390. fileListFrame.Position = UDim2.new(0, 10, 0, 260)
  391. fileListFrame.BackgroundColor3 = Color3.fromRGB(40, 45, 55)
  392. fileListFrame.BackgroundTransparency = 0.7
  393. fileListFrame.BorderSizePixel = 0
  394. fileListFrame.ClipsDescendants = true
  395. fileListFrame.Visible = false
  396. fileListFrame.Parent = mainFrame
  397.  
  398. local fileListCorner = Instance.new("UICorner")
  399. fileListCorner.CornerRadius = UDim.new(0, 6)
  400. fileListCorner.Parent = fileListFrame
  401.  
  402. local scrollFrame = Instance.new("ScrollingFrame")
  403. scrollFrame.Size = UDim2.new(1, -8, 1, -8)
  404. scrollFrame.Position = UDim2.new(0, 4, 0, 4)
  405. scrollFrame.BackgroundColor3 = Color3.fromRGB(50, 55, 65)
  406. scrollFrame.BackgroundTransparency = 0.5
  407. scrollFrame.BorderSizePixel = 0
  408. scrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  409. scrollFrame.ScrollBarThickness = 6
  410. scrollFrame.Parent = fileListFrame
  411.  
  412. local scrollCorner = Instance.new("UICorner")
  413. scrollCorner.CornerRadius = UDim.new(0, 4)
  414. scrollCorner.Parent = scrollFrame
  415.  
  416. local scrollBar = Instance.new("UIListLayout")
  417. scrollBar.SortOrder = Enum.SortOrder.LayoutOrder
  418. scrollBar.Padding = UDim.new(0, 4)
  419. scrollBar.Parent = scrollFrame
  420.  
  421. local noFilesLabel = Instance.new("TextLabel")
  422. noFilesLabel.Size = UDim2.new(1, -16, 0, 30)
  423. noFilesLabel.Position = UDim2.new(0, 8, 0, 8)
  424. noFilesLabel.Text = "No animations found"
  425. noFilesLabel.TextColor3 = Color3.fromRGB(150, 160, 180)
  426. noFilesLabel.TextSize = 14
  427. noFilesLabel.Font = Enum.Font.Gotham
  428. noFilesLabel.BackgroundTransparency = 1
  429. noFilesLabel.Visible = false
  430. noFilesLabel.Parent = scrollFrame
  431.  
  432. local footer = Instance.new("Frame")
  433. footer.Size = UDim2.new(1, -20, 0, 24)
  434. footer.Position = UDim2.new(0, 10, 1, -34)
  435. footer.BackgroundColor3 = Color3.fromRGB(40, 45, 55)
  436. footer.BackgroundTransparency = 0.6
  437. footer.BorderSizePixel = 0
  438. footer.Parent = mainFrame
  439.  
  440. local footerCorner = Instance.new("UICorner")
  441. footerCorner.CornerRadius = UDim.new(0, 8)
  442. footerCorner.Parent = footer
  443.  
  444. local footerText = Instance.new("TextLabel")
  445. footerText.Size = UDim2.new(1, -16, 1, -4)
  446. footerText.Position = UDim2.new(0, 8, 0, 2)
  447. footerText.Text = "Animation System v2.0"
  448. footerText.TextColor3 = Color3.fromRGB(150, 160, 180)
  449. footerText.TextSize = 12
  450. footerText.Font = Enum.Font.Gotham
  451. footerText.BackgroundTransparency = 1
  452. footerText.Parent = footer
  453.  
  454. -- Make GUI draggable - FIXED PROPERLY
  455. titleBar.InputBegan:Connect(function(input)
  456. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  457. dragging = true
  458. dragStart = input.Position
  459. startPos = mainFrame.Position
  460.  
  461. input.Changed:Connect(function()
  462. if input.UserInputState == Enum.UserInputState.End then
  463. dragging = false
  464. end
  465. end)
  466. end
  467. end)
  468.  
  469. titleBar.InputChanged:Connect(function(input)
  470. if input.UserInputType == Enum.UserInputType.MouseMovement then
  471. dragInput = input
  472. end
  473. end)
  474.  
  475. UserInputService.InputChanged:Connect(function(input)
  476. if input == dragInput and dragging then
  477. local delta = input.Position - dragStart
  478. mainFrame.Position = UDim2.new(
  479. startPos.X.Scale,
  480. startPos.X.Offset + delta.X,
  481. startPos.Y.Scale,
  482. startPos.Y.Offset + delta.Y
  483. )
  484. end
  485. end)
  486.  
  487. closeButton.MouseButton1Click:Connect(function()
  488. screenGui.Enabled = false
  489. end)
  490.  
  491. -- Add hover effects
  492. local function addButtonHoverEffect(button, normalColor, hoverColor)
  493. button.MouseEnter:Connect(function()
  494. TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = hoverColor}):Play()
  495. end)
  496. button.MouseLeave:Connect(function()
  497. TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = normalColor}):Play()
  498. end)
  499. end
  500.  
  501. addButtonHoverEffect(loopToggle, Color3.fromRGB(100, 60, 60), Color3.fromRGB(130, 70, 70))
  502. addButtonHoverEffect(saveBtn, Color3.fromRGB(50, 140, 70), Color3.fromRGB(60, 160, 80))
  503. addButtonHoverEffect(listBtn, Color3.fromRGB(60, 100, 140), Color3.fromRGB(70, 120, 160))
  504. addButtonHoverEffect(closeButton, Color3.fromRGB(200, 70, 70), Color3.fromRGB(220, 90, 90))
  505.  
  506. return screenGui, saveBox, saveBtn, listBtn, scrollFrame, statusLabel, loopToggle, fileListFrame, noFilesLabel
  507. end
  508.  
  509. local gui, saveBox, saveBtn, listBtn, scrollFrame, statusLabel, loopToggle, fileListFrame, noFilesLabel = createModernGUI()
  510.  
  511. local function updateStatus(status, color)
  512. statusLabel.Text = "Status: " .. status
  513. TweenService:Create(statusLabel, TweenInfo.new(0.3), {
  514. TextColor3 = color or Color3.fromRGB(180, 180, 200)
  515. }):Play()
  516. end
  517.  
  518. local function updateGUI()
  519. if isRecording then
  520. updateStatus("RECORDING", Color3.fromRGB(220, 80, 80))
  521. elseif isReplaying then
  522. updateStatus("PLAYING", Color3.fromRGB(80, 160, 220))
  523. else
  524. updateStatus("Idle", Color3.fromRGB(180, 180, 200))
  525. end
  526. end
  527.  
  528. loopToggle.MouseButton1Click:Connect(function()
  529. isLooping = not isLooping
  530. loopToggle.Text = "LOOP: " .. (isLooping and "ON" or "OFF")
  531. loopToggle.BackgroundColor3 = isLooping and Color3.fromRGB(60, 120, 60) or Color3.fromRGB(100, 60, 60)
  532. updateGUI()
  533. end)
  534.  
  535. local function refreshFileList()
  536. if not FileSystem.Enabled then return end
  537.  
  538. for _, child in ipairs(scrollFrame:GetChildren()) do
  539. if child:IsA("TextButton") then
  540. child:Destroy()
  541. end
  542. end
  543.  
  544. local files = FileSystem.List(FOLDER_NAME)
  545. local hasFiles = false
  546.  
  547. if files and #files > 0 then
  548. table.sort(files)
  549. for _, path in ipairs(files) do
  550. if path:match("%.json$") then
  551. hasFiles = true
  552. local filename = path:match("([^/]+)%.json$")
  553.  
  554. local fileBtn = Instance.new("TextButton")
  555. fileBtn.Size = UDim2.new(1, -8, 0, 28)
  556. fileBtn.BackgroundColor3 = Color3.fromRGB(55, 60, 70)
  557. fileBtn.BackgroundTransparency = 0.6
  558. fileBtn.BorderSizePixel = 0
  559. fileBtn.TextColor3 = Color3.fromRGB(210, 210, 230)
  560. fileBtn.TextSize = 14
  561. fileBtn.Font = Enum.Font.Gotham
  562. fileBtn.Text = filename
  563. fileBtn.Parent = scrollFrame
  564.  
  565. local fileCorner = Instance.new("UICorner")
  566. fileCorner.CornerRadius = UDim.new(0, 4)
  567. fileCorner.Parent = fileBtn
  568.  
  569. local fileIcon = Instance.new("TextLabel")
  570. fileIcon.Size = UDim2.new(0, 20, 1, -4)
  571. fileIcon.Position = UDim2.new(0, 4, 0, 2)
  572. fileIcon.Text = "▶"
  573. fileIcon.TextColor3 = Color3.fromRGB(180, 200, 230)
  574. fileIcon.Font = Enum.Font.GothamBold
  575. fileIcon.BackgroundTransparency = 1
  576. fileIcon.Parent = fileBtn
  577.  
  578. fileBtn.MouseButton1Click:Connect(function()
  579. recordedFrames = deserializeFrames(FileSystem.Read(FOLDER_NAME .. "/" .. filename .. ".json"))
  580. updateStatus("Loaded: " .. filename)
  581. end)
  582.  
  583. fileBtn.MouseEnter:Connect(function()
  584. TweenService:Create(fileBtn, TweenInfo.new(0.2), {
  585. BackgroundColor3 = Color3.fromRGB(70, 75, 85)
  586. }):Play()
  587. end)
  588.  
  589. fileBtn.MouseLeave:Connect(function()
  590. TweenService:Create(fileBtn, TweenInfo.new(0.2), {
  591. BackgroundColor3 = Color3.fromRGB(55, 60, 70)
  592. }):Play()
  593. end)
  594. end
  595. end
  596. end
  597.  
  598. noFilesLabel.Visible = not hasFiles
  599. scrollFrame.CanvasSize = UDim2.new(0, 0, 0, math.max(30, #scrollFrame:GetChildren() * 32))
  600. end
  601.  
  602. saveBtn.MouseButton1Click:Connect(function()
  603. if not FileSystem.Enabled or #recordedFrames == 0 then
  604. updateStatus("No frames to save!", Color3.fromRGB(220, 100, 100))
  605. return
  606. end
  607.  
  608. local name = saveBox.Text:trim()
  609. if name == "" then
  610. updateStatus("Enter animation name!", Color3.fromRGB(220, 100, 100))
  611. return
  612. end
  613.  
  614. FileSystem.Write(FOLDER_NAME .. "/" .. name .. ".json", serializeFrames(recordedFrames))
  615. updateStatus("Saved: " .. name, Color3.fromRGB(100, 200, 100))
  616. refreshFileList()
  617. end)
  618.  
  619. listBtn.MouseButton1Click:Connect(function()
  620. fileListFrame.Visible = not fileListFrame.Visible
  621. listBtn.Text = fileListFrame.Visible and "📁 HIDE LIBRARY" or "📁 ANIMATION LIBRARY"
  622. if fileListFrame.Visible then
  623. refreshFileList()
  624. end
  625. end)
  626.  
  627. -- Auto refresh file list every 0.5 seconds
  628. spawn(function()
  629. while wait(0.5) do
  630. if fileListFrame.Visible and FileSystem.Enabled then
  631. refreshFileList()
  632. end
  633. end
  634. end)
  635.  
  636. local function replayOnClone()
  637. if isRecording or isReplaying or #recordedFrames == 0 then
  638. updateStatus("No animation loaded!", Color3.fromRGB(220, 100, 100))
  639. return
  640. end
  641.  
  642. if not myClone then spawnClone(); wait(0.1) end
  643.  
  644. isReplaying = true
  645. updateGUI()
  646.  
  647. local cloneRoot = myClone:FindFirstChild("HumanoidRootPart")
  648. if cloneRoot then cloneRoot.Anchored = true end
  649.  
  650. for _, partName in ipairs(bodyPartNames) do
  651. local p = myClone:FindFirstChild(partName)
  652. if p then
  653. for _, d in pairs(myClone:GetDescendants()) do
  654. if d:IsA("Motor6D") and d.Part1 == p then d:Destroy() end
  655. end
  656. end
  657. end
  658.  
  659. local recStart = recordedFrames[1]["HumanoidRootPart"].CFrame
  660. local cloneStart = cloneRoot.CFrame
  661. local offsetMatrix = cloneStart * recStart:Inverse()
  662.  
  663. local frameIndex = 1
  664. replayConnection = RunService.RenderStepped:Connect(function()
  665. if frameIndex <= #recordedFrames and myClone and myClone.Parent then
  666. local frameData = recordedFrames[frameIndex]
  667. for _, partName in ipairs(bodyPartNames) do
  668. local p = myClone:FindFirstChild(partName)
  669. if p and frameData[partName] then
  670. p.CFrame = offsetMatrix * frameData[partName].CFrame
  671. end
  672. end
  673. frameIndex = frameIndex + 1
  674. else
  675. if isLooping and myClone and myClone.Parent then
  676. frameIndex = 1
  677. else
  678. if replayConnection then replayConnection:Disconnect(); replayConnection = nil end
  679. isReplaying = false
  680. spawnClone()
  681. updateGUI()
  682. end
  683. end
  684. end)
  685. end
  686.  
  687. local function startRecording()
  688. if isRecording or isReplaying then
  689. updateStatus("Busy!", Color3.fromRGB(220, 100, 100))
  690. return
  691. end
  692.  
  693. character = player.Character
  694. if not character then
  695. updateStatus("No character!", Color3.fromRGB(220, 100, 100))
  696. return
  697. end
  698.  
  699. playerBodyParts = {}
  700. for _, n in ipairs(bodyPartNames) do
  701. local p = character:FindFirstChild(n)
  702. if p then table.insert(playerBodyParts, p) end
  703. end
  704.  
  705. if #playerBodyParts == 0 then
  706. updateStatus("No body parts!", Color3.fromRGB(220, 100, 100))
  707. return
  708. end
  709.  
  710. isRecording = true; recordedFrames = {}
  711. recordConnection = RunService.RenderStepped:Connect(function()
  712. local f = {}
  713. for _, p in ipairs(playerBodyParts) do
  714. if p and p.Parent then
  715. f[p.Name] = {CFrame = p.CFrame}
  716. end
  717. end
  718. table.insert(recordedFrames, f)
  719. updateGUI()
  720. end)
  721.  
  722. updateStatus("Recording...", Color3.fromRGB(220, 80, 80))
  723. end
  724.  
  725. UserInputService.InputBegan:Connect(function(input, processed)
  726. if processed then return end
  727.  
  728. if input.KeyCode == RECORD_KEY then
  729. if isRecording then
  730. isRecording = false
  731. if recordConnection then recordConnection:Disconnect() end
  732. updateStatus("Recording stopped", Color3.fromRGB(100, 200, 100))
  733. else
  734. startRecording()
  735. end
  736. elseif input.KeyCode == REPLAY_KEY then
  737. replayOnClone()
  738. elseif input.KeyCode == RESPAWN_KEY then
  739. spawnClone()
  740. updateStatus("Clone spawned", Color3.fromRGB(100, 160, 220))
  741. end
  742. end)
  743.  
  744. spawnClone()
  745. refreshFileList()
  746.  
  747. -- Show GUI initially
  748. gui.Enabled = true
Advertisement
Add Comment
Please, Sign In to add comment