Advertisement
NeverCords

BASCOM AVR AXOJXK 12

Oct 1st, 2022
2,373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local table_of = {}
  2.  
  3. local playanother = false
  4. local playing = false
  5. local rtrnv;
  6. local c;
  7. local tbl3;
  8. local v;
  9. local anim;
  10. local count;
  11. local hhhh;
  12. local asdf;
  13. local animid;
  14. local plr = game.Players.LocalPlayer
  15. local char = game:GetService("Players").LocalPlayer.Character
  16. local cframe = char.HumanoidRootPart.CFrame
  17. local torso = game:GetService("Players").LocalPlayer.Character.Torso
  18. local rs = torso["Right Shoulder"]
  19. local ls = torso["Left Shoulder"]
  20. local rh = torso["Right Hip"]
  21. local lh = torso["Left Hip"]
  22. local n = torso["Neck"]
  23. local rj = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart["RootJoint"]
  24. local rsc0 = rs.C0
  25. local lsc0 = ls.C0
  26. local rhc0 = rh.C0
  27. local lhc0 = lh.C0
  28. local rjc0 = rj.C0
  29. local nc0 = n.C0
  30. local gc0 = CFrame.new()
  31. local orsc0 = rs.C0
  32. local olsc0 = ls.C0
  33. local orhc0 = rh.C0
  34. local olhc0 = lh.C0
  35. local orjc0 = rj.C0
  36. local onc0 = n.C0
  37. local count2 = 100
  38. local maxcount2=100
  39.  
  40. local function getnext(tbl,number)
  41.     c=100
  42.     rtrnv=0
  43.     for i,v in pairs(tbl) do
  44.         if i>number and i-number<c then
  45.             c=i-number
  46.             rtrnv=i
  47.         end
  48.     end
  49.     return(rtrnv)
  50. end
  51. local function wait2(tim)
  52.     if tim<0.1 then
  53.         game:GetService("RunService").Heartbeat:Wait()
  54.     else
  55.         for i=1,tim*40 do
  56.             game:GetService("RunService").Heartbeat:Wait()
  57.         end
  58.     end
  59. end
  60. local function kftotbl(kf)
  61.     tbl3 = {}
  62.     for i,v in pairs(kf:GetDescendants()) do
  63.         if v:IsA("Pose") then
  64.             tbl3[string.sub(v.Name,1,1)..string.sub(v.Name,#v.Name,#v.Name)] = v.CFrame
  65.         end
  66.     end
  67.     return(tbl3)
  68. end
  69.  
  70. function table_of:Play(AnimationID)
  71.     if AnimationID ~= "" then
  72.         if playing == true then
  73.             playing = false
  74.             playanother = true
  75.         end
  76.         wait()
  77.         spawn(function()
  78.             if playanother == true then
  79.                 playanother = false
  80.             end
  81.             playing = true
  82.             wait(.1)
  83.             animid="rbxassetid://".. AnimationID
  84.             game:GetService("RunService").Heartbeat:Connect(function()
  85.                 if playanother == true then
  86.                     return nil
  87.                 else
  88.                     count2 = count2+1
  89.                     if count2<=maxcount2 then
  90.                         rs.Transform=rs.Transform:Lerp(rsc0,count2/maxcount2)
  91.                         ls.Transform=ls.Transform:Lerp(lsc0,count2/maxcount2)
  92.                         rh.Transform=rh.Transform:Lerp(rhc0,count2/maxcount2)
  93.                         lh.Transform=lh.Transform:Lerp(lhc0,count2/maxcount2)
  94.                         n.Transform=n.Transform:Lerp(nc0,count2/maxcount2)
  95.                         rj.Transform=rj.Transform:Lerp(rjc0,count2/maxcount2)
  96.                     end
  97.                 end
  98.             end)
  99.             animid=game:GetObjects(animid)[1]
  100.             anim={}
  101.             for i,v in pairs(animid:GetChildren()) do
  102.                 if v:IsA("Keyframe") then
  103.                     anim[v.Time]=kftotbl(v)
  104.                 end
  105.             end
  106.  
  107.             count = 0
  108.             char=game:GetService("Players").LocalPlayer.Character
  109.             hhhh=game:GetService("Players").LocalPlayer.Character.Humanoid.Animator
  110.             hhhh.Parent = nil
  111.             for _,v in pairs(char.Humanoid:GetPlayingAnimationTracks()) do
  112.                 v:Stop()
  113.             end
  114.  
  115.             plr.CharacterRemoving:Connect(function()
  116.                 if playing == true then
  117.                     playing = false
  118.                 end
  119.             end)
  120.  
  121.             while wait() do
  122.                 if playanother == true then
  123.                     break
  124.                 else
  125.                     for i,oasjdadlasdkadkldjkl in pairs(anim) do
  126.                         asdf=getnext(anim,count)
  127.                         v=anim[asdf]
  128.                         if v["Lg"] then
  129.                             lhc0 = v["Lg"]
  130.                         end
  131.                         if v["Rg"] then
  132.                             rhc0 = v["Rg"]
  133.                         end
  134.                         if v["Lm"] then
  135.                             lsc0 = v["Lm"]
  136.                         end
  137.                         if v["Rm"] then
  138.                             rsc0 = v["Rm"]
  139.                         end
  140.                         if v["To"] then
  141.                             rjc0 = v["To"]
  142.                         end
  143.                         if v["Hd"] then
  144.                             nc0 = v["Hd"]
  145.                         end
  146.                         count2=0
  147.                         maxcount2=asdf-count
  148.                         count=asdf
  149.                         wait(asdf-count)
  150.                         count2=maxcount2
  151.                         if v["Lg"] then
  152.                             char.Torso["Left Hip"].Transform = v["Lg"]
  153.                         end
  154.                         if v["Rg"] then
  155.                             char.Torso["Right Hip"].Transform = v["Rg"]
  156.                         end
  157.                         if v["Lm"] then
  158.                             char.Torso["Left Shoulder"].Transform = v["Lm"]
  159.                         end
  160.                         if v["Rm"] then
  161.                             char.Torso["Right Shoulder"].Transform = v["Rm"]
  162.                         end
  163.                         if v["To"] then
  164.                             char.HumanoidRootPart["RootJoint"].Transform = v["To"]
  165.                         end
  166.                         if v["Hd"] then
  167.                             char.Torso["Neck"].Transform = v["Hd"]
  168.                         end
  169.                     end
  170.                 end
  171.             end
  172.         end)
  173.     end
  174. end
  175.  
  176. return table_of
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement