DrawingJhon

cool animation r4p3

Aug 28th, 2020 (edited)
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.79 KB | None | 0 0
  1. local function inject(owner)
  2.  
  3. local nls = NLS([==[local owner = game:service("Players").LocalPlayer
  4. local remote = script:WaitForChild("REEE")
  5. local OpRemote = script:WaitForChild("LOL")
  6. local mouse = owner:GetMouse()
  7. local db = true
  8.  
  9. remote.OnClientInvoke = function()
  10.     if owner.Character then
  11.         local hum = owner.Character:findFirstChildOfClass("Humanoid")
  12.         if hum then
  13.             for i, v in pairs(hum:GetPlayingAnimationTracks()) do
  14.                 v:Stop()
  15.             end
  16.         end
  17.     end
  18. end
  19. mouse.KeyDown:Connect(function(key)
  20.     if key:lower() == "e" then
  21.         if db == true then
  22.             OpRemote:FireServer("bang")
  23.             db = false
  24.         else
  25.             OpRemote:FireServer("unbang")
  26.             db = true
  27.         end
  28.     end
  29. end)
  30.  
  31. ]==], owner)
  32.  
  33. nls.Name = "BruhMoment"
  34. NLS([[local plr = game:GetService("Players").LocalPlayer
  35. local da = plr:WaitForChild("BruhMoment")
  36. da.Parent = plr:findFirstChildOfClass("PlayerScripts")]], owner:findFirstChildOfClass("PlayerGui"))
  37.  
  38. local remote = Instance.new("RemoteFunction", nls)
  39. remote.Name = "REEE"
  40.  
  41. local doRemote = Instance.new("RemoteEvent", nls)
  42. doRemote.Name = "LOL"
  43.  
  44. local loop = true
  45.  
  46. local function getParts(torso, rootPart)
  47.     return {
  48.         TTorso = rootPart.RootJoint;
  49.         RArm = torso:findFirstChild("Right Shoulder");
  50.         LArm = torso:findFirstChild("Left Shoulder");
  51.         RLeg = torso:findFirstChild("Right Hip");
  52.         LLeg = torso:findFirstChild("Left Hip");
  53.         neck = torso:findFirstChild("Neck");
  54.     }
  55. end
  56.  
  57. local function CFAngles(n1, n2, n3)
  58.     return CFrame.Angles(math.rad(n1 or 0), math.rad(n2 or 0), math.rad(n3 or 0))
  59. end
  60.  
  61. local function animate(cfs, da, parts)
  62.     for p, cf in pairs(cfs) do
  63.         local p =game:GetService("TweenService"):Create(parts[p], TweenInfo.new(da), {C0 = cf})
  64.         p:Play()
  65.         coroutine.wrap(function()
  66.             repeat game:GetService("RunService").Heartbeat:Wait() until not loop
  67.             p:Pause()
  68.         end)()
  69.     end
  70.     wait(da)
  71. end
  72.  
  73. local function pos(cfs, parts)
  74.     for p, cf in pairs(cfs) do
  75.         parts[p].C0 = cf
  76.     end
  77. end
  78.  
  79.  
  80. local defCF = {
  81.     TTorso = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0);
  82.     RArm = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0);
  83.     LArm = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0);
  84.     RLeg = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0);
  85.     LLeg = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0);
  86.     neck = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0);
  87. }
  88.  
  89. local animator
  90. local function setDefault(plr)
  91.     loop = false
  92.     if plr.Character then
  93.         local hum = plr.Character:findFirstChildOfClass("Humanoid")
  94.         if hum then
  95.             animator.Parent = hum
  96.         end
  97.         local animate = plr.Character:findFirstChild("Animate")
  98.         if animate and animate:IsA("Script") then
  99.             animate.Disabled = false
  100.         end
  101.         local parts = getParts(plr.Character.Torso, plr.Character.HumanoidRootPart)
  102.         wait()
  103.         for i, v in pairs(defCF) do
  104.             parts[i].C0 = v
  105.         end
  106.     end
  107. end
  108.  
  109. local function bang(plr)
  110.     local Character = plr.Character
  111.     if Character then
  112.         local humanoid = Character:findFirstChildOfClass("Humanoid")
  113.         if not humanoid then return end
  114.         for i, v in pairs(humanoid:GetPlayingAnimationTracks()) do
  115.             v:Stop()
  116.         end
  117.         remote:InvokeClient(plr)
  118.         animator = humanoid:findFirstChild("Animator")
  119.         pcall(function()
  120.             animator.Parent = nil
  121.         end)
  122.         local animatexd = plr.Character:findFirstChild("Animate")
  123.         local torso = Character:findFirstChild("Torso")
  124.         local rootPart = Character:findFirstChild("HumanoidRootPart")
  125.         if not torso or not rootPart then return end
  126.         local parts = getParts(torso, rootPart)    
  127.  
  128.         animatexd.Disabled = true
  129.         wait()
  130.    
  131.        
  132.         local cframes1 = {
  133.             RArm = defCF["RArm"] * CFrame.Angles(0, 0, math.rad(53));
  134.             LArm = defCF["LArm"] * CFrame.Angles(0, 0, math.rad(-53));
  135.             TTorso = defCF.TTorso * CFrame.Angles(math.rad(8), 0, 0);
  136.             RLeg = defCF.RLeg * CFrame.Angles(0, 0, math.rad(8));
  137.             LLeg = defCF.LLeg * CFrame.Angles(0, 0, math.rad(-8));
  138.             neck = defCF.neck * CFrame.Angles(math.rad(15.5), 0, 0);
  139.         }
  140.  
  141.         local cframes2 = {
  142.             RArm = defCF["RArm"] * CFrame.Angles(0, 0, math.rad(35));
  143.             LArm = defCF["LArm"] * CFrame.Angles(0, 0, math.rad(-35));
  144.             TTorso = defCF.TTorso * CFrame.Angles(math.rad(-13), 0, 0);
  145.             RLeg = defCF.RLeg * CFrame.Angles(0, 0, math.rad(-21));
  146.             LLeg = defCF.LLeg * CFrame.Angles(0, 0, math.rad(21));
  147.             neck = defCF.neck * CFrame.Angles(math.rad(18.5), 0, 0);
  148.         }
  149.         pos(cframes1, parts)
  150.         while loop do
  151.             animate(cframes2, 0.35, parts)
  152.             if not loop then return end
  153.             animate(cframes1, 0.4, parts)
  154.         end
  155.     end
  156. end
  157.  
  158. local function dog(plr)
  159.     local Character = plr.Character
  160.     if Character then
  161.         local humanoid = Character:findFirstChildOfClass("Humanoid")
  162.         if not humanoid then return end
  163.         for i, v in pairs(humanoid:GetPlayingAnimationTracks()) do
  164.             v:Stop()
  165.         end
  166.         remote:InvokeClient(plr)
  167.         animator = humanoid:findFirstChild("Animator")
  168.         pcall(function()
  169.             animator.Parent = nil
  170.         end)
  171.         local animatexd = plr.Character:findFirstChild("Animate")
  172.         local torso = Character:findFirstChild("Torso")
  173.         local rootPart = Character:findFirstChild("HumanoidRootPart")
  174.         if not torso or not rootPart then return end
  175.         local parts = getParts(torso, rootPart)    
  176.  
  177.         animatexd.Disabled = true
  178.         wait()
  179.  
  180.         local cframes1 = {
  181.             RArm = defCF["RArm"] * CFAngles();
  182.             LArm = defCF["LArm"] * CFAngles();
  183.             TTorso = defCF.TTorso * CFAngles(90, 0, 0);
  184.             RLeg = defCF.RLeg * CFAngles(0, 0, 90);
  185.             LLeg = defCF.LLeg * CFAngles(0, 0, -90);
  186.             neck = defCF.neck * CFAngles();
  187.         }
  188.         pos(cframes1, parts)   
  189.     end
  190. end
  191.  
  192. doRemote.OnServerEvent:Connect(function(plr, action)
  193.     if plr ~= owner then return end
  194.     if action == "bang" then
  195.         loop = true
  196.         bang(owner)
  197.     elseif action == "unbang" then
  198.         setDefault(plr)
  199.     end
  200. end)
  201.  
  202. end
  203.  
  204. local Players = game:GetService("Players")
  205.  
  206. for _, plr in pairs(Players:GetPlayers()) do
  207.     coroutine.wrap(inject)(plr)
  208. end
  209.  
  210. Players.PlayerAdded:Connect(inject)
Add Comment
Please, Sign In to add comment