Josiahiscool73

r15 animation player

Dec 24th, 2025
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.75 KB | None | 0 0
  1. -- // SERVICES // --
  2. local Players = game:GetService("Players")
  3. local CoreGui = game:GetService("CoreGui")
  4. local HttpService = game:GetService("HttpService")
  5. local UserInputService = game:GetService("UserInputService")
  6. local RunService = game:GetService("RunService")
  7.  
  8. local LocalPlayer = Players.LocalPlayer
  9. local FileName = "MobileAnimSaves_Converted.json" -- Changed name to avoid conflicts
  10.  
  11. -- // SAVE SYSTEM // --
  12. local SavedAnimations = {}
  13.  
  14. local function LoadData()
  15. if isfile and isfile(FileName) then
  16. local success, result = pcall(function()
  17. return HttpService:JSONDecode(readfile(FileName))
  18. end)
  19. if success then
  20. SavedAnimations = result
  21. end
  22. end
  23. end
  24.  
  25. local function SaveData()
  26. if writefile then
  27. writefile(FileName, HttpService:JSONEncode(SavedAnimations))
  28. end
  29. end
  30.  
  31. LoadData()
  32.  
  33. -- // CONVERSION LOGIC // --
  34. local function ConvertToAnimID(catalogID)
  35. -- If it's already an asset link, just return it
  36. if string.find(catalogID, "rbxassetid") then
  37. return catalogID
  38. end
  39.  
  40. -- Attempt to convert via game:GetObjects
  41. local success, result = pcall(function()
  42. local objects = game:GetObjects("rbxassetid://" .. catalogID)
  43. local foundAnim = nil
  44.  
  45. for _, obj in pairs(objects) do
  46. if obj:IsA("Animation") then
  47. foundAnim = obj
  48. break
  49. else
  50. local child = obj:FindFirstChildWhichIsA("Animation", true)
  51. if child then
  52. foundAnim = child
  53. break
  54. end
  55. end
  56. end
  57.  
  58. -- Cleanup
  59. for _, obj in pairs(objects) do
  60. obj:Destroy()
  61. end
  62.  
  63. return foundAnim and foundAnim.AnimationId or nil
  64. end)
  65.  
  66. if success and result then
  67. return result
  68. else
  69. return nil
  70. end
  71. end
  72.  
  73. -- // UI SETUP // --
  74. local ScreenGui = Instance.new("ScreenGui")
  75. ScreenGui.Name = "DeltaAnimConverterUI"
  76. pcall(function() ScreenGui.Parent = gethui and gethui() or CoreGui end)
  77. if not ScreenGui.Parent then ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") end
  78.  
  79. -- Helper: Rounded Corners
  80. local function AddCorner(instance, radius)
  81. local corner = Instance.new("UICorner")
  82. corner.CornerRadius = UDim.new(0, radius)
  83. corner.Parent = instance
  84. return corner
  85. end
  86.  
  87. -- Helper: Draggable
  88. local function MakeDraggable(guiObject, dragHandle)
  89. local dragging, dragInput, dragStart, startPos
  90. local handle = dragHandle or guiObject
  91.  
  92. handle.InputBegan:Connect(function(input)
  93. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  94. dragging = true
  95. dragStart = input.Position
  96. startPos = guiObject.Position
  97.  
  98. input.Changed:Connect(function()
  99. if input.UserInputState == Enum.UserInputState.End then dragging = false end
  100. end)
  101. end
  102. end)
  103.  
  104. guiObject.InputChanged:Connect(function(input)
  105. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  106. dragInput = input
  107. end
  108. end)
  109.  
  110. UserInputService.InputChanged:Connect(function(input)
  111. if input == dragInput and dragging then
  112. local delta = input.Position - dragStart
  113. guiObject.Position = UDim2.new(
  114. startPos.X.Scale, startPos.X.Offset + delta.X,
  115. startPos.Y.Scale, startPos.Y.Offset + delta.Y
  116. )
  117. end
  118. end)
  119. end
  120.  
  121. -- // UI CONSTRUCTION // --
  122.  
  123. -- Toggle Button
  124. local ToggleBtn = Instance.new("TextButton")
  125. ToggleBtn.Size = UDim2.new(0, 50, 0, 50)
  126. ToggleBtn.Position = UDim2.new(0, 20, 0.4, 0)
  127. ToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 120, 215)
  128. ToggleBtn.Text = "UI"
  129. ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  130. ToggleBtn.Font = Enum.Font.GothamBold
  131. ToggleBtn.TextSize = 18
  132. ToggleBtn.Parent = ScreenGui
  133. AddCorner(ToggleBtn, 12)
  134. MakeDraggable(ToggleBtn)
  135.  
  136. -- Main Frame
  137. local MainFrame = Instance.new("Frame")
  138. MainFrame.Size = UDim2.new(0, 320, 0, 400)
  139. MainFrame.Position = UDim2.new(0.5, -160, 0.5, -200)
  140. MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  141. MainFrame.Visible = false
  142. MainFrame.Parent = ScreenGui
  143. AddCorner(MainFrame, 12)
  144.  
  145. -- Title Bar
  146. local TitleBar = Instance.new("Frame")
  147. TitleBar.Size = UDim2.new(1, 0, 0, 45)
  148. TitleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  149. TitleBar.Parent = MainFrame
  150. AddCorner(TitleBar, 12)
  151.  
  152. local TitleLabel = Instance.new("TextLabel")
  153. TitleLabel.Text = "AUTO CONVERTER & PLAYER"
  154. TitleLabel.Size = UDim2.new(1, 0, 1, 0)
  155. TitleLabel.BackgroundTransparency = 1
  156. TitleLabel.TextColor3 = Color3.fromRGB(220, 220, 220)
  157. TitleLabel.Font = Enum.Font.GothamBold
  158. TitleLabel.TextSize = 14
  159. TitleLabel.Parent = TitleBar
  160.  
  161. MakeDraggable(MainFrame, TitleBar)
  162.  
  163. local CloseMain = Instance.new("TextButton")
  164. CloseMain.Size = UDim2.new(0, 45, 0, 45)
  165. CloseMain.Position = UDim2.new(1, -45, 0, 0)
  166. CloseMain.BackgroundTransparency = 1
  167. CloseMain.Text = "X"
  168. CloseMain.TextColor3 = Color3.fromRGB(200, 50, 50)
  169. CloseMain.Font = Enum.Font.GothamBold
  170. CloseMain.TextSize = 20
  171. CloseMain.Parent = TitleBar
  172. CloseMain.MouseButton1Click:Connect(function() MainFrame.Visible = false end)
  173.  
  174. ToggleBtn.MouseButton1Click:Connect(function() MainFrame.Visible = not MainFrame.Visible end)
  175.  
  176. -- Tabs
  177. local TabFrame = Instance.new("Frame")
  178. TabFrame.Size = UDim2.new(0.9, 0, 0, 40)
  179. TabFrame.Position = UDim2.new(0.05, 0, 0.14, 0)
  180. TabFrame.BackgroundTransparency = 1
  181. TabFrame.Parent = MainFrame
  182.  
  183. local function CreateTab(text, xPos)
  184. local btn = Instance.new("TextButton")
  185. btn.Size = UDim2.new(0.48, 0, 1, 0)
  186. btn.Position = UDim2.new(xPos, 0, 0, 0)
  187. btn.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  188. btn.Text = text
  189. btn.TextColor3 = Color3.fromRGB(255, 255, 255)
  190. btn.Font = Enum.Font.GothamBold
  191. btn.TextSize = 14
  192. btn.Parent = TabFrame
  193. AddCorner(btn, 8)
  194. return btn
  195. end
  196.  
  197. local ImportTab = CreateTab("Converter", 0)
  198. local SavedTab = CreateTab("Saved List", 0.52)
  199.  
  200. -- Pages
  201. local PageFrame = Instance.new("Frame")
  202. PageFrame.Size = UDim2.new(0.9, 0, 0.7, 0)
  203. PageFrame.Position = UDim2.new(0.05, 0, 0.27, 0)
  204. PageFrame.BackgroundTransparency = 1
  205. PageFrame.Parent = MainFrame
  206.  
  207. local ImportPage = Instance.new("Frame")
  208. ImportPage.Size = UDim2.new(1, 0, 1, 0)
  209. ImportPage.BackgroundTransparency = 1
  210. ImportPage.Parent = PageFrame
  211.  
  212. local SavedPage = Instance.new("ScrollingFrame")
  213. SavedPage.Size = UDim2.new(1, 0, 1, 0)
  214. SavedPage.BackgroundTransparency = 1
  215. SavedPage.ScrollBarThickness = 4
  216. SavedPage.Visible = false
  217. SavedPage.Parent = PageFrame
  218.  
  219. local UIList = Instance.new("UIListLayout")
  220. UIList.Padding = UDim.new(0, 8)
  221. UIList.Parent = SavedPage
  222.  
  223. -- // CONVERTER PAGE // --
  224. local IDBox = Instance.new("TextBox")
  225. IDBox.Size = UDim2.new(1, 0, 0, 45)
  226. IDBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  227. IDBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  228. IDBox.PlaceholderText = "Paste Catalog ID Here"
  229. IDBox.Text = ""
  230. IDBox.Font = Enum.Font.Gotham
  231. IDBox.TextSize = 14
  232. IDBox.Parent = ImportPage
  233. AddCorner(IDBox, 8)
  234.  
  235. local NameBox = Instance.new("TextBox")
  236. NameBox.Size = UDim2.new(1, 0, 0, 45)
  237. NameBox.Position = UDim2.new(0, 0, 0, 55)
  238. NameBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  239. NameBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  240. NameBox.PlaceholderText = "Name (e.g. Griddy)"
  241. NameBox.Text = ""
  242. NameBox.Font = Enum.Font.Gotham
  243. NameBox.TextSize = 14
  244. NameBox.Parent = ImportPage
  245. AddCorner(NameBox, 8)
  246.  
  247. local ConvertSaveBtn = Instance.new("TextButton")
  248. ConvertSaveBtn.Size = UDim2.new(1, 0, 0, 50)
  249. ConvertSaveBtn.Position = UDim2.new(0, 0, 0, 110)
  250. ConvertSaveBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  251. ConvertSaveBtn.Text = "CONVERT & SAVE"
  252. ConvertSaveBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  253. ConvertSaveBtn.Font = Enum.Font.GothamBold
  254. ConvertSaveBtn.TextSize = 16
  255. ConvertSaveBtn.Parent = ImportPage
  256. AddCorner(ConvertSaveBtn, 8)
  257.  
  258. local StatusLabel = Instance.new("TextLabel")
  259. StatusLabel.Size = UDim2.new(1, 0, 0, 30)
  260. StatusLabel.Position = UDim2.new(0, 0, 0, 170)
  261. StatusLabel.BackgroundTransparency = 1
  262. StatusLabel.Text = "Idle"
  263. StatusLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
  264. StatusLabel.Font = Enum.Font.Gotham
  265. StatusLabel.TextSize = 12
  266. StatusLabel.Parent = ImportPage
  267.  
  268. -- // POPUP CONTROLLER (PLAYER) // --
  269. local ControlFrame = Instance.new("Frame")
  270. ControlFrame.Size = UDim2.new(0, 220, 0, 140)
  271. ControlFrame.Position = UDim2.new(0.5, 30, 0.4, 0)
  272. ControlFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  273. ControlFrame.Visible = false
  274. ControlFrame.Parent = ScreenGui
  275. AddCorner(ControlFrame, 12)
  276. MakeDraggable(ControlFrame)
  277.  
  278. local ControlTitle = Instance.new("TextLabel")
  279. ControlTitle.Size = UDim2.new(1, 0, 0, 30)
  280. ControlTitle.BackgroundTransparency = 1
  281. ControlTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  282. ControlTitle.Font = Enum.Font.GothamBold
  283. ControlTitle.TextSize = 14
  284. ControlTitle.Text = "Selected Animation"
  285. ControlTitle.Parent = ControlFrame
  286.  
  287. local CloseControl = Instance.new("TextButton")
  288. CloseControl.Size = UDim2.new(0, 30, 0, 30)
  289. CloseControl.Position = UDim2.new(1, -30, 0, 0)
  290. CloseControl.BackgroundTransparency = 1
  291. CloseControl.Text = "X"
  292. CloseControl.TextColor3 = Color3.fromRGB(200, 50, 50)
  293. CloseControl.Font = Enum.Font.GothamBold
  294. CloseControl.TextSize = 18
  295. CloseControl.Parent = ControlFrame
  296. CloseControl.MouseButton1Click:Connect(function() ControlFrame.Visible = false end)
  297.  
  298. local PlayBtn = Instance.new("TextButton")
  299. PlayBtn.Size = UDim2.new(0.9, 0, 0, 40)
  300. PlayBtn.Position = UDim2.new(0.05, 0, 0.25, 0)
  301. PlayBtn.BackgroundColor3 = Color3.fromRGB(40, 200, 40)
  302. PlayBtn.Text = "PLAY"
  303. PlayBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  304. PlayBtn.Font = Enum.Font.GothamBold
  305. PlayBtn.TextSize = 16
  306. PlayBtn.Parent = ControlFrame
  307. AddCorner(PlayBtn, 8)
  308.  
  309. local StopBtn = Instance.new("TextButton")
  310. StopBtn.Size = UDim2.new(0.9, 0, 0, 40)
  311. StopBtn.Position = UDim2.new(0.05, 0, 0.6, 0)
  312. StopBtn.BackgroundColor3 = Color3.fromRGB(200, 40, 40)
  313. StopBtn.Text = "STOP"
  314. StopBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  315. StopBtn.Font = Enum.Font.GothamBold
  316. StopBtn.TextSize = 16
  317. StopBtn.Parent = ControlFrame
  318. AddCorner(StopBtn, 8)
  319.  
  320. -- // LOGIC // --
  321. local currentTrack = nil
  322. local currentID = ""
  323.  
  324. local function RefreshList()
  325. for _, v in pairs(SavedPage:GetChildren()) do
  326. if v:IsA("Frame") then v:Destroy() end
  327. end
  328.  
  329. for i, data in ipairs(SavedAnimations) do
  330. local ItemFrame = Instance.new("Frame")
  331. ItemFrame.Size = UDim2.new(1, 0, 0, 50)
  332. ItemFrame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  333. ItemFrame.Parent = SavedPage
  334. AddCorner(ItemFrame, 8)
  335.  
  336. local SelectBtn = Instance.new("TextButton")
  337. SelectBtn.Size = UDim2.new(0.75, 0, 1, 0)
  338. SelectBtn.BackgroundTransparency = 1
  339. SelectBtn.Text = " " .. data.Name
  340. SelectBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  341. SelectBtn.TextXAlignment = Enum.TextXAlignment.Left
  342. SelectBtn.Font = Enum.Font.GothamBold
  343. SelectBtn.TextSize = 14
  344. SelectBtn.Parent = ItemFrame
  345.  
  346. SelectBtn.MouseButton1Click:Connect(function()
  347. ControlFrame.Visible = true
  348. ControlTitle.Text = data.Name
  349. currentID = data.ID
  350. end)
  351.  
  352. local DeleteBtn = Instance.new("TextButton")
  353. DeleteBtn.Size = UDim2.new(0.2, 0, 0.8, 0)
  354. DeleteBtn.Position = UDim2.new(0.78, 0, 0.1, 0)
  355. DeleteBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
  356. DeleteBtn.Text = "DEL"
  357. DeleteBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  358. DeleteBtn.Font = Enum.Font.GothamBold
  359. DeleteBtn.TextSize = 12
  360. DeleteBtn.Parent = ItemFrame
  361. AddCorner(DeleteBtn, 6)
  362.  
  363. DeleteBtn.MouseButton1Click:Connect(function()
  364. table.remove(SavedAnimations, i)
  365. SaveData()
  366. RefreshList()
  367. end)
  368. end
  369. SavedPage.CanvasSize = UDim2.new(0, 0, 0, UIList.AbsoluteContentSize.Y + 10)
  370. end
  371.  
  372. -- Play Logic
  373. PlayBtn.MouseButton1Click:Connect(function()
  374. if not currentID or currentID == "" then return end
  375.  
  376. local char = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  377. local hum = char:FindFirstChild("Humanoid")
  378. local animator = hum:FindFirstChild("Animator") or Instance.new("Animator", hum)
  379.  
  380. if currentTrack then currentTrack:Stop() end
  381.  
  382. local anim = Instance.new("Animation")
  383. anim.AnimationId = currentID -- ID is already converted in the list
  384.  
  385. currentTrack = animator:LoadAnimation(anim)
  386. currentTrack.Priority = Enum.AnimationPriority.Action
  387. currentTrack:Play()
  388. end)
  389.  
  390. StopBtn.MouseButton1Click:Connect(function()
  391. if currentTrack then currentTrack:Stop() end
  392. end)
  393.  
  394. -- Tab Switching
  395. ImportTab.MouseButton1Click:Connect(function()
  396. ImportPage.Visible = true
  397. SavedPage.Visible = false
  398. ImportTab.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  399. SavedTab.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  400. end)
  401.  
  402. SavedTab.MouseButton1Click:Connect(function()
  403. ImportPage.Visible = false
  404. SavedPage.Visible = true
  405. ImportTab.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  406. SavedTab.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  407. RefreshList()
  408. end)
  409.  
  410. -- CONVERT AND SAVE BUTTON LOGIC
  411. ConvertSaveBtn.MouseButton1Click:Connect(function()
  412. local rawInput = IDBox.Text
  413. local nameInput = NameBox.Text
  414.  
  415. if rawInput == "" or nameInput == "" then
  416. StatusLabel.Text = "Please fill in both boxes!"
  417. StatusLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
  418. return
  419. end
  420.  
  421. ConvertSaveBtn.Text = "CONVERTING..."
  422. StatusLabel.Text = "Fetching ID from Roblox..."
  423. StatusLabel.TextColor3 = Color3.fromRGB(255, 255, 100)
  424.  
  425. -- Run conversion
  426. local finalID = ConvertToAnimID(rawInput)
  427.  
  428. if finalID then
  429. -- Success
  430. table.insert(SavedAnimations, {Name = nameInput, ID = finalID})
  431. SaveData()
  432.  
  433. ConvertSaveBtn.Text = "SUCCESS!"
  434. StatusLabel.Text = "Saved: " .. finalID
  435. StatusLabel.TextColor3 = Color3.fromRGB(100, 255, 100)
  436.  
  437. IDBox.Text = ""
  438. NameBox.Text = ""
  439.  
  440. task.wait(1)
  441. ConvertSaveBtn.Text = "CONVERT & SAVE"
  442. StatusLabel.Text = "Idle"
  443. StatusLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
  444. else
  445. -- Fail
  446. ConvertSaveBtn.Text = "FAILED"
  447. StatusLabel.Text = "Could not find animation in that ID."
  448. StatusLabel.TextColor3 = Color3.fromRGB(255, 50, 50)
  449. task.wait(1.5)
  450. ConvertSaveBtn.Text = "CONVERT & SAVE"
  451. end
  452. end)
  453.  
  454. RefreshList()
Advertisement
Add Comment
Please, Sign In to add comment