Advertisement
Darkaf

animation

Feb 21st, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.50 KB | None | 0 0
  1. save = nil
  2. c3 = function(r,g,b) return Color3.new(r/255,g/255,b/255) end
  3.  
  4. --do something ro get save file
  5.  
  6. if not save then
  7. save = {
  8. ui = {
  9. highlightcolor = c3(33, 122, 255);
  10. errorcolor = c3(255, 0, 0);
  11. --AnimationPriority colors
  12. core = c3(65, 65, 65);
  13. idle = c3(134, 200, 230);
  14. movement = c3(114, 230, 121);
  15. action = c3(235, 235, 235);
  16. };
  17. preferences = {
  18.  
  19. };
  20. custom_animations = {
  21. template = {
  22. Title = "";
  23. AnimationId = "rbxassetid://";
  24. Image = "rbxassetid://2151539455"; --not required
  25. Speed = 1;
  26. Time = 0;
  27. Weight = 1;
  28. Loop = false;
  29. R6 = true;
  30. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  31. };
  32. };
  33. }
  34. end
  35.  
  36. lp = game:GetService("Players").LocalPlayer
  37. m = lp:GetMouse()
  38.  
  39. function getHumanoid()
  40. if not lp.Character then return nil end
  41. return lp.Character:FindFirstChildWhichIsA("Humanoid")
  42. end
  43.  
  44. screengui = game:GetObjects("rbxassetid://02159099015")[1]
  45. screengui.Parent = game:GetService("CoreGui")
  46. main = screengui.Topbar.Main
  47.  
  48. mainframe = main.MainFrame
  49. scrollframe = mainframe.ScrollingFrame
  50. items = scrollframe.Items
  51. search = scrollframe.SearchFrame.Search
  52. searchbutton = scrollframe.SearchFrame.ImageLabel.TextButton
  53. searchframe = scrollframe.SearchFrame
  54.  
  55. preview = main.Preview
  56. previewimage = preview.Image
  57. previewtitle = preview.Title
  58. previewdesc = preview.Desc
  59.  
  60. function draggable(gObj)
  61. local UserInputService = game:GetService("UserInputService")
  62.  
  63. local gui = gObj
  64.  
  65. local dragging
  66. local dragInput
  67. local dragStart
  68. local startPos
  69.  
  70. local function update(input)
  71. local delta = input.Position - dragStart
  72. gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  73. end
  74.  
  75. gui.InputBegan:Connect(function(input)
  76. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  77. dragging = true
  78. dragStart = input.Position
  79. startPos = gui.Position
  80.  
  81. input.Changed:Connect(function()
  82. if input.UserInputState == Enum.UserInputState.End then
  83. dragging = false
  84. end
  85. end)
  86. end
  87. end)
  88.  
  89. gui.InputChanged:Connect(function(input)
  90. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  91. dragInput = input
  92. end
  93. end)
  94.  
  95. UserInputService.InputChanged:Connect(function(input)
  96. if input == dragInput and dragging then
  97. update(input)
  98. end
  99. end)
  100. end
  101. function tween(object,style,direction,t,goal)
  102. local tweenservice = game:GetService("TweenService")
  103. local tweenInfo = TweenInfo.new(t,Enum.EasingStyle[style],Enum.EasingDirection[direction])
  104. local tween = tweenservice:Create(object,tweenInfo,goal)
  105. tween:Play()
  106. return tween
  107. end
  108.  
  109. draggable(screengui.Topbar)
  110.  
  111. function checkIfStudio()
  112. return game.Name ~= "Game"
  113. end
  114.  
  115. if not checkIfStudio() then
  116. print'Client is not in Roblox studio'
  117. --main.Size = UDim2.new(0.398, 0, 0.477, 0)
  118. end
  119.  
  120. search.Changed:connect(function(p)
  121. local n = 0
  122. for i,v in pairs (items:GetChildren()) do
  123. if v:IsA("TextButton") and not string.find(v.Title.Text:lower(), search.Text:lower()) then
  124. v.Visible = false
  125. elseif v:IsA("TextButton") and string.find(v.Title.Text:lower(), search.Text:lower()) then
  126. v.Visible = true
  127. n = n + 1
  128. end
  129. end
  130. if p == "Text" then
  131. if n > 0 then
  132. tween(searchframe, "Sine", "Out", 0.25, {
  133. BorderColor3 = save.ui.highlightcolor;
  134. })
  135. wait(0.25)
  136. tween(searchframe, "Sine", "In", 0.5, {
  137. BorderColor3 = c3(58, 58, 58);
  138. })
  139. else
  140. tween(searchframe, "Sine", "Out", 0.25, {
  141. BorderColor3 = save.ui.errorcolor;
  142. })
  143. wait(0.25)
  144. tween(searchframe, "Sine", "In", 0.5, {
  145. BorderColor3 = c3(58, 58, 58);
  146. })
  147. end
  148. end
  149. end)
  150.  
  151. spawn(function()
  152. while wait(10) do
  153. --auto-save every 10 seconds
  154. end
  155. end)
  156.  
  157. cam = workspace.CurrentCamera
  158.  
  159. running = {}
  160. popAnims = {
  161. armturbine = {
  162. Title = "Arm Turbine";
  163. AnimationId = "rbxassetid://259438880";
  164. Speed = 1.5;
  165. Time = 0;
  166. Weight = 1;
  167. Loop = true;
  168. R6 = true;
  169. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  170. };
  171. weirdsway = {
  172. Title = "Weird Sway";
  173. AnimationId = "rbxassetid://248336677";
  174. Speed = 1;
  175. Time = 0;
  176. Weight = 1;
  177. Loop = true;
  178. R6 = true;
  179. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  180. };
  181. weirdfloat = {
  182. Title = "Weird Float";
  183. AnimationId = "rbxassetid://248336459";
  184. Speed = 1;
  185. Time = 0;
  186. Weight = 1;
  187. Loop = true;
  188. R6 = true;
  189. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  190. };
  191. weirdpose = {
  192. Title = "Weird Pose";
  193. AnimationId = "rbxassetid://248336163";
  194. Speed = 1;
  195. Time = 0;
  196. Weight = 1;
  197. Loop = true;
  198. R6 = true;
  199. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  200. };
  201. penguinslide = {
  202. Title = "Penguin Slide";
  203. AnimationId = "rbxassetid://282574440";
  204. Speed = 1;
  205. Time = 0;
  206. Weight = 1;
  207. Loop = true;
  208. R6 = true;
  209. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  210. };
  211. scream = {
  212. Title = "Scream";
  213. AnimationId = "rbxassetid://180611870";
  214. Speed = 1.5;
  215. Time = 0;
  216. Weight = 1;
  217. Loop = true;
  218. R6 = true;
  219. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  220. };
  221. crouch = {
  222. Title = "Crouch";
  223. AnimationId = "rbxassetid://182724289";
  224. Speed = 1;
  225. Time = 0;
  226. Weight = 1;
  227. Loop = true;
  228. R6 = true;
  229. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  230. };
  231. happydance = {
  232. Title = "Happy Dance";
  233. AnimationId = "rbxassetid://248335946";
  234. Speed = 1;
  235. Time = 0;
  236. Weight = 1;
  237. Loop = true;
  238. R6 = true;
  239. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  240. };
  241. floatinghead = {
  242. Title = "Floating Head";
  243. AnimationId = "rbxassetid://121572214";
  244. Speed = 1;
  245. Time = 0;
  246. Weight = 1;
  247. Loop = true;
  248. R6 = true;
  249. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  250. };
  251. balloonfloat = {
  252. Title = "Balloon Float";
  253. AnimationId = "rbxassetid://148840371";
  254. Speed = 1;
  255. Time = 0;
  256. Weight = 1;
  257. Loop = true;
  258. R6 = true;
  259. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  260. };
  261. pinchnose = {
  262. Title = "Pinch Nose";
  263. AnimationId = "rbxassetid://30235165";
  264. Speed = 1;
  265. Time = 0;
  266. Weight = 1;
  267. Loop = true;
  268. R6 = true;
  269. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  270. };
  271. goal = {
  272. Title = "Goal!";
  273. AnimationId = "rbxassetid://28488254";
  274. Speed = 1;
  275. Time = 0;
  276. Weight = 1;
  277. Loop = true;
  278. R6 = true;
  279. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  280. };
  281. cry = {
  282. Title = "Cry";
  283. AnimationId = "rbxassetid://180612465";
  284. Speed = 0;
  285. Time = 1.5;
  286. Weight = 1;
  287. Loop = true;
  288. R6 = true;
  289. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  290. };
  291. partytime = {
  292. Title = "Party Time";
  293. AnimationId = "rbxassetid://33796059";
  294. Speed = 1;
  295. Time = 0;
  296. Weight = 1;
  297. Loop = true;
  298. R6 = true;
  299. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  300. };
  301. moondance = {
  302. Title = "Moon Dance";
  303. AnimationId = "rbxassetid://27789359";
  304. Speed = 1;
  305. Time = 0;
  306. Weight = 1;
  307. Loop = true;
  308. R6 = true;
  309. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  310. };
  311. insanelegs = {
  312. Title = "Insane Legs";
  313. AnimationId = "rbxassetid://87986341";
  314. Speed = 99;
  315. Time = 0;
  316. Weight = 1;
  317. Loop = true;
  318. R6 = true;
  319. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  320. };
  321. rotation = {
  322. Title = "Rotation";
  323. AnimationId = "rbxassetid://136801964";
  324. Speed = 1;
  325. Time = 0;
  326. Weight = 1;
  327. Loop = true;
  328. R6 = true;
  329. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  330. };
  331. insanerotation = {
  332. Title = "Insane Rotation";
  333. AnimationId = "rbxassetid://136801964";
  334. Speed = 99;
  335. Time = 0;
  336. Weight = 1;
  337. Loop = true;
  338. R6 = true;
  339. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  340. };
  341. roar = {
  342. Title = "Roar";
  343. AnimationId = "rbxassetid://163209885";
  344. Speed = 1;
  345. Time = 0;
  346. Weight = 1;
  347. Loop = true;
  348. R6 = true;
  349. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  350. };
  351. spin = {
  352. Title = "Spin";
  353. AnimationId = "rbxassetid://188632011";
  354. Speed = 1;
  355. Time = 0;
  356. Weight = 1;
  357. Loop = true;
  358. R6 = true;
  359. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  360. };
  361. zombiearms = {
  362. Title = "Zombie Arms";
  363. AnimationId = "rbxassetid://183294396";
  364. Speed = 0;
  365. Time = 0;
  366. Weight = 1;
  367. Loop = true;
  368. R6 = true;
  369. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  370. };
  371. insane = {
  372. Title = "Insane";
  373. AnimationId = "rbxassetid://33796059";
  374. Speed = 99;
  375. Time = 0;
  376. Weight = 1;
  377. Loop = true;
  378. R6 = true;
  379. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  380. };
  381. neckbreak = {
  382. Title = "Neck Break";
  383. AnimationId = "rbxassetid://35154961";
  384. Speed = 0;
  385. Time = 2;
  386. Weight = 1;
  387. Loop = true;
  388. R6 = true;
  389. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  390. };
  391. headdetach = {
  392. Title = "Head Detach";
  393. AnimationId = "rbxassetid://35154961";
  394. Speed = 0;
  395. Time = 3;
  396. Weight = 1;
  397. Loop = true;
  398. R6 = true;
  399. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  400. };
  401. idle = {
  402. Title = "Idle";
  403. AnimationId = "rbxassetid://180435571";
  404. Speed = 1;
  405. Time = 0;
  406. Weight = 1;
  407. Loop = true;
  408. R6 = true;
  409. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  410. };
  411. charleston = {
  412. Title = "Charleston";
  413. AnimationId = "rbxassetid://429703734";
  414. Speed = 1;
  415. Time = 0;
  416. Weight = 1;
  417. Loop = true;
  418. R6 = true;
  419. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  420. };
  421. }
  422. robloxOwns = {}
  423.  
  424. ownerOwns = {}
  425.  
  426. customAnims = {}
  427.  
  428. function getOwnedAnimations(userid)
  429. local httpserv = game:GetService("HttpService")
  430. local owned = httpserv:GetAsync("https://inventory.roblox.com/v1/users/"..userid.."/inventory/Animation?pageNumber=1&itemsPerPage=10", true)
  431. return owned
  432. end
  433.  
  434.  
  435. function getAnim(name)
  436. return popAnims[name] or customAnims[name]
  437. end
  438. function runAnim(info, humanoid)
  439. local animation = Instance.new("Animation")
  440. animation.AnimationId = info.AnimationId
  441.  
  442. local animtrack = humanoid:LoadAnimation(animation)
  443. table.insert(running,animtrack)
  444. animtrack.Priority = info.Priority
  445. animtrack.Looped = info.Loop
  446.  
  447. animtrack:Play()
  448. animtrack:AdjustSpeed(info.Speed)
  449. animtrack:AdjustWeight(info.Weight)
  450. animtrack.TimePosition = info.Time
  451.  
  452. animtrack.Stopped:connect(function()
  453. for i = 1,#running do
  454. if running[i] == animtrack then
  455. table.remove(running,i)
  456. end
  457. end
  458. end)
  459.  
  460. return animtrack
  461. end
  462.  
  463. template = items.Template
  464. template.Parent = nil
  465.  
  466. function clear()
  467. for i,v in pairs (items:GetChildren()) do
  468. if v:IsA("TextButton") then
  469. v:Destroy()
  470. end
  471. end
  472. end
  473.  
  474. --[[
  475. idle = {
  476. Title = "Idle";
  477. AnimationId = "rbxassetid://180435571";
  478. Speed = 1;
  479. Time = 0;
  480. Weight = 1;
  481. Loop = true;
  482. R6 = true;
  483. Priority = 2; --0, 1, 2, and 1000 are acceptable priorities
  484. };
  485. --]]
  486.  
  487. function createbutton(v)
  488. local temp = template:Clone()
  489. temp.Parent = items
  490. temp.Name = v.Title
  491. temp.Title.Text = v.Title
  492. temp.Image.Image = v.Image or "rbxassetid://2151539455"
  493. if temp.Image.Image == "rbxassetid://2151539455" then
  494. temp.Image.ImageColor3 = (v.Priority == 0 and save.ui.idle) or (v.Priority == 1 and save.ui.movement) or (v.Priority == 2 and save.ui.action) or (v.Priority == 1000 and save.ui.core)
  495. else
  496. temp.Image.ImageColor3 = Color3.new(1,1,1)
  497. end
  498. temp.LayoutOrder = math.random(1,10000)
  499.  
  500. temp.Settings.AnimationId.Value = v.AnimationId
  501. temp.Settings.Loop.Value = v.Loop
  502. temp.Settings.Priority.Value = v.Priority
  503. temp.Settings.R6.Value = v.R6
  504. temp.Settings.Speed.Value = v.Speed
  505. temp.Settings.Weight.Value = v.Weight
  506. temp.Settings.Time.Value = v.Time
  507.  
  508. temp.MouseEnter:connect(function()
  509. preview.Title.Text = v.Title
  510. preview.Desc.Text = "Speed: "..tostring(v.Speed).."\nPriority: "..tostring(v.Priority).."\nR6 Rig: "..tostring(v.R6).."\nAnimID: "..tostring(v.AnimationId).."\n\n"..(v.Description or "No description provided")
  511.  
  512. preview.Image.Image = v.Image or "rbxassetid://2151539455"
  513. if preview.Image.Image == "rbxassetid://2151539455" then
  514. preview.Image.ImageColor3 = (v.Priority == 0 and save.ui.idle) or (v.Priority == 1 and save.ui.movement) or (v.Priority == 2 and save.ui.action) or (v.Priority == 1000 and save.ui.core)
  515. else
  516. preview.Image.ImageColor3 = Color3.new(1,1,1)
  517. end
  518. end)
  519. temp.MouseButton1Click:connect(function()
  520. temp.Border.ImageColor3 = save.ui.highlightcolor
  521. for i,anim in pairs (running) do
  522. if anim.Animation.AnimationId == v.AnimationId then
  523. anim:Stop()
  524. return
  525. end
  526. end
  527. temp.Border.Visible = true
  528. local rAnim = runAnim(v, getHumanoid())
  529. rAnim.Stopped:connect(function()
  530. temp.Border.Visible = false
  531. end)
  532. end)
  533.  
  534. return temp
  535. end
  536.  
  537. dropdown = mainframe.ScrollingFrame.DropdownFrame
  538. elements = dropdown.HoldContentsFrame.Frame.Elements
  539. dropdownenabled = true
  540.  
  541. tween(dropdown.HoldContentsFrame.Frame, "Linear", "In", 0, {
  542. Position = UDim2.new(0,0,-1,0)
  543. })
  544. dropdown.HoldContentsFrame.Frame.Visible = false
  545.  
  546. dropdowndeactivate = screengui.DropdownDeactivate
  547. dropdowndeactivate.Visible = false
  548.  
  549. function hideddown()
  550. tween(dropdown.HoldContentsFrame.Frame, "Linear", "In", 0, {
  551. Position = UDim2.new(0,0,-1,0)
  552. })
  553. dropdown.HoldContentsFrame.Frame.Visible = false
  554. dropdowndeactivate.Visible = false
  555. dropdownenabled = true
  556.  
  557. for i,e in pairs (elements:GetChildren()) do
  558. if e:IsA("TextButton") then
  559. e.BackgroundColor3 = c3(46,46,46)
  560. end
  561. end
  562. end
  563.  
  564. dropdown.MouseButton1Click:connect(function()
  565. print'ddownclick'
  566. dropdownenabled = not dropdownenabled
  567. if dropdownenabled then
  568. hideddown()
  569. else
  570. tween(dropdown.HoldContentsFrame.Frame, "Linear", "In", 0.3, {
  571. Position = UDim2.new(0,0,0,0)
  572. })
  573. dropdown.HoldContentsFrame.Frame.Visible = true
  574. dropdowndeactivate.Visible = true
  575. end
  576. end)
  577.  
  578. dropdowndeactivate.MouseButton1Down:connect(function()
  579. hideddown()
  580. end)
  581.  
  582. for i,v in pairs (elements:GetChildren()) do
  583. if v:IsA("TextButton") then
  584. v.MouseEnter:connect(function()
  585. for i,e in pairs (elements:GetChildren()) do
  586. if e:IsA("TextButton") then
  587. e.BackgroundColor3 = c3(46,46,46)
  588. end
  589. end
  590. v.BackgroundColor3 = save.ui.highlightcolor
  591. end)
  592. v.MouseButton1Click:connect(function()
  593. hideddown()
  594. dropdown.TextLabel.Text = v.Name
  595. sort(v.Name)
  596. end)
  597. end
  598. end
  599.  
  600. function sort(category)
  601. clear()
  602. if category == "Popular" then
  603. for i,v in pairs (popAnims) do
  604. local temp = createbutton(v)
  605. end
  606. elseif category == "By Roblox" then
  607.  
  608. end
  609. end
  610.  
  611. game:GetService('RunService').RenderStepped:connect(function()
  612. items.Parent.CanvasSize = UDim2.new(0,0,0,items.GridLayout.AbsoluteContentSize.Y + 50)
  613. end)
  614.  
  615. sort("Popular")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement