Advertisement
Gomlsauresrex

Animation Switcher

Dec 8th, 2017
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. --[[
  2. Animation Switcher
  3. by chexyalani
  4.  
  5. Note : please run this a script (use h/https://pastebin.com/raw/jTjugUtz)
  6. --]]
  7.  
  8. local h = Instance.new('Hint',workspace)
  9. h.Text = 'Now Loading Animation Switcher, by Dev_Basics'
  10. local players=game:FindService("Players")
  11. local player=game:FindService("Players").LocalPlayer
  12. local as=game:GetService("AssetService")
  13. local is=game:GetService("InsertService")
  14. local AnimNames={
  15. ['ninja']=658839027;
  16. ['levitation']=619547874;
  17. ['superhero']=619533495;
  18. ['robot']=619526284;
  19. ['stylish']=619520125;
  20. ['cartoony']=837018588;
  21. ['bubbly']=1018570389;
  22. ['zombie']=619540515;
  23. ['werewolf']=1113761759;
  24. ['vampire']=1113748071;
  25. ['mage']=754668466;
  26. ['toy']=973784877;
  27. ['elder']=892276056;
  28. ['astronaut']=1090142671;
  29. ['pirate']=837029051;
  30. ['knight']=734338331;
  31. }
  32. local chatted=function(msg)
  33. msg=msg:lower()
  34. if msg:sub(1,6)==':anim ' then
  35. local pl,p
  36. for i=7,msg:len() do
  37. if msg:sub(i,i)==' ' then
  38. p=i
  39. end
  40. end
  41. for _,v in pairs(players:GetPlayers()) do
  42. if (v.Name:lower()):sub(1,#msg:sub(7,p-1))==msg:sub(7,p-1) then
  43. pl=v
  44. end
  45. end
  46. local assets=as:GetAssetIdsForPackage(AnimNames[msg:sub(p+1)])
  47. for i=1,#assets do
  48. local asset=is:LoadAsset(assets[i]):GetChildren()[1]
  49. asset.Parent=workspace
  50. for _,i in pairs(asset:GetChildren()) do
  51. if pl.Character.Animate:FindFirstChild(i.Name) then pl.Character.Animate[i.Name]:Destroy() end
  52. i.Parent=pl.Character.Animate
  53. end
  54. asset:Destroy()
  55. end
  56. end
  57. end
  58.  
  59. for _,v in pairs(players:GetChildren()) do
  60. v.Chatted:Connect(function(msg)
  61. chatted(msg)
  62. end)
  63. end
  64.  
  65. players.ChildAdded:Connect(function(client)
  66. client.Chatted:Connect(function(msg)
  67. chatted(msg)
  68. end)
  69. end)
  70.  
  71. wait(5)
  72.  
  73. h:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement