mewishmeww

grabSystem

Jul 23rd, 2023 (edited)
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.52 KB | None | 0 0
  1. local playername = owner.Name
  2. repeat wait() until game.Players:WaitForChild(playername).Character or game.Players:WaitForChild(playername).CharacterAdded:Wait()
  3.  
  4. local tool = Instance.new("Tool",game.Players:WaitForChild(playername).Backpack)
  5. tool.RequiresHandle = false
  6. tool.Name = "GrabTool"
  7. tool.ToolTip = "Grabbing to the run"
  8.  
  9.  
  10. local equipped = false
  11.  
  12. function newRoot(char)
  13.     local root = Instance.new("Part")
  14.     root.Parent = char
  15.     root.Size = char.Torso.Size
  16.     root.Name = "HumanoidRootPart"
  17.     root.Transparency = 1
  18.     local rootJoint = Instance.new("Motor6D")
  19.     rootJoint.Parent = root
  20.     rootJoint.Part0 = root
  21.     rootJoint.Part1 = char:FindFirstChild("Torso")
  22.     rootJoint.C0 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  23.     rootJoint.C1 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  24.     rootJoint.Name = "RootJoint"
  25. end
  26.  
  27. function motortoweld(m)
  28.     local weld
  29.     if m ~= nil then
  30.         weld = Instance.new("Weld")
  31.         weld.Part0 = m.Part0
  32.         weld.Part1 = m.Part1
  33.         weld.C0 = m.C0
  34.         weld.C1 = m.C1
  35.         weld.Name = m.Name.. " Weld"
  36.         return weld
  37.     end
  38.     return false
  39. end
  40.  
  41. function save(s)
  42.     local cl = s:Clone()
  43.     s:Destroy()
  44.     return cl
  45. end
  46.  
  47. local PLR
  48. local HRP
  49. local Torso
  50. local motorleftarm
  51. local motorrightarm
  52. local motortorso
  53. local torsoW
  54. local leftArmW
  55. local RightArmW
  56. local grabbing = false
  57. local ArmsOut = false
  58. local hitboxTime = 1
  59. local canActivate = true
  60. local check = 1
  61. local cooldown = 1.5
  62.  
  63. local OChar
  64. local OTorso
  65. local WeldTogether
  66.  
  67. local HeadOS
  68. local TorsoOS
  69. local LArmOS
  70. local RArmOS
  71. local LLegOS
  72. local RLegOS
  73. local HeadO
  74. local TorsoO
  75. local LArmO
  76. local RArmO
  77. local LLegO
  78. local RLegO
  79. local oppr15 = false
  80. local hasAnims = false
  81.  
  82. function idle()
  83.     game:GetService("TweenService"):Create(HRP:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)}):Play()
  84.     game:GetService("TweenService"):Create(Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, 0, 0, -0.241844743, -0.241844743, -0.939692616, -0.707106769, 0.707106769, 0, 0.664462984, 0.664462984, -0.342020124)}):Play()
  85.     game:GetService("TweenService"):Create(Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0, 0, -0.241844654, 0.241844654, 0.939692676, 0.707106769, 0.707106769, 0, -0.664463043, 0.664463043, -0.342020005)}):Play()
  86. end
  87.  
  88. function GrabAnim()
  89.     game:GetService("TweenService"):Create(Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0.5, -0.5, 0.492403895, 0.173648059, 0.852868557, 0.866025388, -3.78551732e-08, -0.5, -0.0868239924, 0.984807789, -0.150383636)}):Play()
  90.     game:GetService("TweenService"):Create(Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, 0.5, -0.5, 0.492403895, -0.173648059, -0.852868557, -0.866025388, -3.78551732e-08, -0.5, 0.0868239924, 0.984807789, -0.150383636)}):Play()
  91.     game:GetService("TweenService"):Create(HRP:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)}):Play()
  92.     wait(0.3)
  93. end
  94.  
  95. function GrabStart(OPP)
  96.     game:GetService("TweenService"):Create(Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0, 0, 1.49501744e-08, 0.342020124, 0.939692616, 1, -4.37113883e-08, 0, 4.10752676e-08, 0.939692616, -0.342020124)}):Play()
  97.     game:GetService("TweenService"):Create(Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, 0, 0, 0.122787811, -0.696364224, -0.707106769, -0.98480773, -0.173648193, 0, -0.122787811, 0.696364224, -0.707106769)}):Play()
  98.     game:GetService("TweenService"):Create(HRP:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, -1, 0.5, -1, -1.3076621e-07, 7.54978942e-08, 0, 0.49999997, 0.866025448, -1.50995803e-07, 0.866025448, -0.49999997)}):Play()
  99.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Left Hip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)}):Play()
  100.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0.707106769, -0.707106769, 0, 0.707106769, 0.707106769, 1, 3.09086197e-08, -3.09086197e-08)}):Play()
  101.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Neck Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, 1, 0, -1, -6.18172393e-08, 6.18172393e-08, 0, 0.707106769, 0.707106769, -8.74227766e-08, 0.707106769, -0.707106769)}):Play()
  102.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Right Hip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)}):Play()
  103.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, -0.707106769, 0.707106769, 0, 0.707106769, 0.707106769, -1, 3.09086197e-08, -3.09086197e-08)}):Play()
  104.     game:GetService("TweenService"):Create(OPP.HumanoidRootPart:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0.5, 0, -1, 1, 0, 0, 0, -4.37113883e-08, 1, 0, -1, -4.37113883e-08)}):Play()
  105.     wait(0.3)
  106.     game:GetService("TweenService"):Create(Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0, 0, 0.342020094, -0.321393847, 0.883022189, -8.21505353e-08, -0.939692616, -0.342020154, 0.939692616, 0.116977692, -0.321393788)}):Play()
  107.     game:GetService("TweenService"):Create(Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-0.5, 0, -1, 0.707106829, -0.499999851, -0.5, 1.06770166e-07, -0.707106829, 0.707106769, -0.707106709, -0.50000006, -0.5)}):Play()
  108.     game:GetService("TweenService"):Create(HRP:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, -0, 0.5, -1, 1.50995803e-07, 6.60023616e-15, 0, -4.37113883e-08, 1, 1.50995803e-07, 1, 4.37113883e-08)}):Play()
  109.     game:GetService("TweenService"):Create(OPP.HumanoidRootPart:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 1.5, 1, 1, 0, 0, 0, 0.939692616, -0.342020154, 0, 0.342020154, 0.939692616)}):Play()
  110.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Left Hip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, -1, 0, 1.91068547e-15, -4.37113883e-08, -1, -1, -4.37113883e-08, 0, -4.37113883e-08, 1, -4.37113883e-08)}):Play()
  111.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, 0.5, 0, -0.707106769, -7.46200044e-08, -0.707106769, -0.707106769, -3.09086197e-08, 0.707106769, -7.46200044e-08, 1, -3.09086197e-08)}):Play()
  112.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Neck Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, 1, 0, -1, -6.18172393e-08, 6.18172393e-08, 0, 0.707106769, 0.707106769, -8.74227766e-08, 0.707106769, -0.707106769)}):Play()
  113.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Right Hip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, -1, 0, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)}):Play()
  114.     game:GetService("TweenService"):Create(OPP.Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0.5, 0, -0.707106769, 7.46200044e-08, 0.707106769, 0.707106769, -3.09086197e-08, 0.707106769, 7.46200044e-08, 1, -3.09086197e-08)}):Play()
  115. end
  116.  
  117. function GrabStartr15(OPP)
  118.     game:GetService("TweenService"):Create(Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0, 0, 1.49501744e-08, 0.342020124, 0.939692616, 1, -4.37113883e-08, 0, 4.10752676e-08, 0.939692616, -0.342020124)}):Play()
  119.     game:GetService("TweenService"):Create(Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-1, 0, 0, 0.122787811, -0.696364224, -0.707106769, -0.98480773, -0.173648193, 0, -0.122787811, 0.696364224, -0.707106769)}):Play()
  120.     game:GetService("TweenService"):Create(HRP:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, -1, 0.5, -1, -1.3076621e-07, 7.54978942e-08, 0, 0.49999997, 0.866025448, -1.50995803e-07, 0.866025448, -0.49999997)}):Play()
  121.  
  122.     game:GetService("TweenService"):Create(OPP.Head:WaitForChild("Neck Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-5.79121036e-08, 0.849033773, 1.19686121e-07, 1, 0, 0, 0, 0.707106769, 0.707106769, 0, -0.707106769, 0.707106769)}):Play()
  123.     game:GetService("TweenService"):Create(OPP.LeftUpperArm:WaitForChild("LeftShoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-0.97160387, 0.597512901, 1.19686121e-07, 0.707106769, 0.707106769, 0, -0.707106769, 0.707106769, 0, 0, 0, 1)}):Play()
  124.     game:GetService("TweenService"):Create(OPP.RightUpperArm:WaitForChild("RightShoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0.971603811, 0.597512901, 1.19686121e-07, 0.707106769, -0.707106769, 0, 0.707106769, 0.707106769, 0, 0, 0, 1)}):Play()
  125.     game:GetService("TweenService"):Create(OPP.RightUpperLeg:WaitForChild("RightHip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0.497852921, -0.200248495, -1.91973395e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1)}):Play()
  126.     game:GetService("TweenService"):Create(OPP.LowerTorso:WaitForChild("Root Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0.5, -1, -1, -1, 0, -1.50995803e-07, 0, 1, 0, 1.50995803e-07, 0, -1)}):Play()
  127.     game:GetService("TweenService"):Create(OPP.LeftUpperLeg:WaitForChild("LeftHip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-0.49785316, -0.200248495, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)}):Play()
  128.     wait(0.3)
  129.     game:GetService("TweenService"):Create(Torso:WaitForChild("Right Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 0, 0, 0.342020094, -0.321393847, 0.883022189, -8.21505353e-08, -0.939692616, -0.342020154, 0.939692616, 0.116977692, -0.321393788)}):Play()
  130.     game:GetService("TweenService"):Create(Torso:WaitForChild("Left Shoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-0.5, 0, -1, 0.707106829, -0.499999851, -0.5, 1.06770166e-07, -0.707106829, 0.707106769, -0.707106709, -0.50000006, -0.5)}):Play()
  131.     game:GetService("TweenService"):Create(HRP:WaitForChild("RootJoint Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0, -0, 0.5, -1, 1.50995803e-07, 6.60023616e-15, 0, -4.37113883e-08, 1, 1.50995803e-07, 1, 4.37113883e-08)}):Play()
  132.  
  133.     game:GetService("TweenService"):Create(OPP.LowerTorso:WaitForChild("Root Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(1, 1.5, -0.5, -1, 8.91785632e-08, -6.18172393e-08, -1.06770166e-07, -0.707106829, 0.707106769, 1.93473753e-08, 0.707106769, 0.707106829)}):Play()
  134.     game:GetService("TweenService"):Create(OPP.RightUpperArm:WaitForChild("RightShoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0.971603811, 0.597512901, 1.19686121e-07, 0.707106769, -0.49999997, 0.49999997, 0, -0.707106769, -0.707106769, 0.707106769, 0.49999997, -0.49999997)}):Play()
  135.     game:GetService("TweenService"):Create(OPP.RightUpperLeg:WaitForChild("RightHip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(0.497852921, -0.200248495, -1.91973395e-05, 1, 0, 0, 0, -4.37113883e-08, -1, 0, 1, -4.37113883e-08)}):Play()
  136.     game:GetService("TweenService"):Create(OPP.LeftUpperArm:WaitForChild("LeftShoulder Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-0.97160387, 0.597512901, 1.19686121e-07, 0.707106769, 0.49999997, -0.49999997, 0, -0.707106769, -0.707106769, -0.707106769, 0.49999997, -0.49999997)}):Play()
  137.     game:GetService("TweenService"):Create(OPP.LeftUpperLeg:WaitForChild("LeftHip Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-0.49785316, -0.200248495, -0, 1, 0, 0, 0, -4.37113883e-08, -1, 0, 1, -4.37113883e-08)}):Play()
  138.     game:GetService("TweenService"):Create(OPP.Head:WaitForChild("Neck Weld"),TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),{C0 = CFrame.new(-5.79121036e-08, 0.849033773, 1.19686121e-07, 1, 0, 0, 0, 0.707106769, 0.707106769, 0, -0.707106769, 0.707106769)}):Play()
  139. end
  140.  
  141. tool.Equipped:Connect(function()
  142.     if not grabbing then
  143.         Char = tool.Parent
  144.         PLR = game.Players:WaitForChild(Char.Name)
  145.         HRP = Char.HumanoidRootPart
  146.         Torso = Char.Torso
  147.         leftArmW = motortoweld(Char.Torso["Left Shoulder"])
  148.         RightArmW = motortoweld(Char.Torso["Right Shoulder"])
  149.         torsoW = motortoweld(Char.HumanoidRootPart.RootJoint)
  150.         motorleftarm = save(Char.Torso["Left Shoulder"])
  151.         motorrightarm = save(Char.Torso["Right Shoulder"])
  152.         motortorso = save(Char.HumanoidRootPart.RootJoint)
  153.         leftArmW.Parent = Char.Torso
  154.         RightArmW.Parent = Char.Torso
  155.         torsoW.Parent = Char.HumanoidRootPart
  156.         Char["Left Arm"].Touched:Connect(grabbed)
  157.         Char["Right Arm"].Touched:Connect(grabbed)
  158.         equipped = true
  159.         idle()
  160.     end
  161. end)
  162.  
  163. tool.Unequipped:Connect(function()
  164.     equipped = false
  165.     if not grabbing then
  166.         motorleftarm.Parent = Char.Torso
  167.         motorrightarm.Parent = Char.Torso
  168.         motortorso.Parent = Char.HumanoidRootPart
  169.         torsoW:Destroy()
  170.         leftArmW:Destroy()
  171.         RightArmW:Destroy()
  172.     end
  173. end)
  174.  
  175. tool.Activated:Connect(function()
  176.     local swagewt = false
  177.     if not grabbing and canActivate and equipped then
  178.         swagewt = true
  179.         canActivate = false
  180.         check += 1
  181.         local ti = check
  182.         ArmsOut = true
  183.         delay(hitboxTime, function()
  184.             if ti == check then
  185.                 ArmsOut = false
  186.             end
  187.         end)
  188.         GrabAnim()
  189.         wait(cooldown)
  190.         if not grabbing then
  191.             idle()
  192.         end
  193.         canActivate = true
  194.     end
  195.     if grabbing and canActivate and equipped and not swagewt then
  196.         WeldTogether:Destroy()
  197.         if grabbing and not oppr15 then
  198.             if hasAnims then
  199.                 HeadO:Destroy()
  200.                 TorsoO:Destroy()
  201.                 LArmO:Destroy()
  202.                 RArmO:Destroy()
  203.                 LLegO:Destroy()
  204.                 RLegO:Destroy()
  205.                 HeadOS.Parent = OChar.Torso
  206.                 TorsoOS.Parent = OChar.HumanoidRootPart
  207.                 LArmOS.Parent = OChar.Torso
  208.                 RArmOS.Parent = OChar.Torso
  209.                 LLegOS.Parent = OChar.Torso
  210.                 RLegOS.Parent = OChar.Torso
  211.             end
  212.             OChar:FindFirstChildWhichIsA("Humanoid").PlatformStand = false
  213.             OChar.HumanoidRootPart.Anchored = true
  214.             Char.HumanoidRootPart.Anchored = true
  215.             if OChar.PrimaryPart ~= nil then
  216.                 OChar:SetPrimaryPartCFrame(Char.HumanoidRootPart.CFrame + Char.HumanoidRootPart.CFrame.LookVector * 3)
  217.             else
  218.                 if OChar:FindFirstChild("HumanoidRootPart") then
  219.                     OChar.PrimaryPart = OChar.HumanoidRootPart
  220.                     OChar:SetPrimaryPartCFrame(Char.HumanoidRootPart.CFrame + Char.HumanoidRootPart.CFrame.LookVector * 3)
  221.                 end
  222.             end
  223.             idle()
  224.             wait(0.5)
  225.             OChar.HumanoidRootPart.Anchored = false
  226.             Char.HumanoidRootPart.Anchored = false
  227.             grabbing = false
  228.         else
  229.             if grabbing and oppr15 then
  230.                 HeadO:Destroy()
  231.                 TorsoO:Destroy()
  232.                 LArmO:Destroy()
  233.                 RArmO:Destroy()
  234.                 LLegO:Destroy()
  235.                 RLegO:Destroy()
  236.                 HeadOS.Parent = OChar.Head
  237.                 TorsoOS.Parent = OChar.LowerTorso
  238.                 LArmOS.Parent = OChar.LeftUpperArm
  239.                 RArmOS.Parent = OChar.RightUpperArm
  240.                 LLegOS.Parent = OChar.LeftUpperLeg
  241.                 RLegOS.Parent = OChar.RightUpperLeg
  242.                 OChar:FindFirstChildWhichIsA("Humanoid").PlatformStand = false
  243.                 OChar.HumanoidRootPart.Anchored = true
  244.                 Char.HumanoidRootPart.Anchored = true
  245.                 WeldTogether:Destroy()
  246.                 OChar:SetPrimaryPartCFrame(Char.HumanoidRootPart.CFrame + Char.HumanoidRootPart.CFrame.LookVector * 3)
  247.                 idle()
  248.                 wait(0.5)
  249.                 OChar.HumanoidRootPart.Anchored = false
  250.                 Char.HumanoidRootPart.Anchored = false
  251.                 grabbing = false
  252.             end
  253.         end
  254.     end
  255. end)
  256.  
  257. function grabbed(Part)
  258.     if ArmsOut and Part.Parent:FindFirstChildWhichIsA("Humanoid") and not grabbing and equipped then
  259.         if not Part.Parent:FindFirstChild("LowerTorso") then
  260.             hasAnims = false
  261.             oppr15 = false
  262.             OChar = Part.Parent
  263.             if not OChar:FindFirstChild("HumanoidRootPart") then
  264.                 newRoot(OChar.Parent)
  265.             end
  266.             local OHRP = Part.Parent.HumanoidRootPart
  267.             OTorso = OChar:FindFirstChild("Torso")
  268.             OChar:FindFirstChildWhichIsA("Humanoid").RequiresNeck = false
  269.             if OTorso:FindFirstChild("Neck") then
  270.                 HeadO = motortoweld(OTorso:WaitForChild("Neck"))
  271.                 LArmO = motortoweld(OTorso:WaitForChild("Left Shoulder"))
  272.                 RArmO = motortoweld(OTorso:WaitForChild("Right Shoulder"))
  273.                 LLegO = motortoweld(OTorso:WaitForChild("Left Hip"))
  274.                 RLegO = motortoweld(OTorso:WaitForChild("Right Hip"))
  275.                 hasAnims = true
  276.             end
  277.             if OChar.HumanoidRootPart:FindFirstChild("RootJoint") then
  278.                 TorsoO = motortoweld(OChar.HumanoidRootPart:WaitForChild("RootJoint"))
  279.                 hasAnims = true
  280.             end
  281.            
  282.             if hasAnims then
  283.                 HeadO.Parent = OTorso
  284.                 TorsoO.Parent = Part.Parent:WaitForChild("HumanoidRootPart")
  285.                 LArmO.Parent = OTorso
  286.                 RArmO.Parent = OTorso
  287.                 LLegO.Parent = OTorso
  288.                 RLegO.Parent = OTorso
  289.                 HeadOS = save(OTorso:WaitForChild("Neck"))
  290.                 TorsoOS = save(Part.Parent:WaitForChild("HumanoidRootPart"):WaitForChild("RootJoint"))
  291.                 LArmOS = save(OTorso:WaitForChild("Left Shoulder"))
  292.                 RArmOS = save(OTorso:WaitForChild("Right Shoulder"))
  293.                 LLegOS = save(OTorso:WaitForChild("Left Hip"))
  294.                 RLegOS = save(OTorso:WaitForChild("Right Hip"))
  295.             end
  296.            
  297.             WeldTogether = Instance.new("Weld")
  298.             WeldTogether.Parent = Char
  299.             WeldTogether.Part0 = OHRP
  300.             WeldTogether.Part1 = HRP
  301.             WeldTogether.Name = "Zuanzale zingel"
  302.            
  303.             grabbing = true
  304.             HRP.Anchored = true
  305.             Char:FindFirstChildWhichIsA("Humanoid").AutoRotate = false
  306.             OChar:FindFirstChildWhichIsA("Humanoid").AutoRotate = false
  307.             OChar:FindFirstChildWhichIsA("Humanoid").PlatformStand = true
  308.             GrabStart(OChar)
  309.             wait(1)
  310.             HRP.Anchored = false
  311.             OChar:WaitForChild("HumanoidRootPart").Anchored = false
  312.             Char.Humanoid.AutoRotate = true
  313.             OChar.Humanoid.AutoRotate = true
  314.             OChar.Humanoid.PlatformStand = true
  315.         else
  316.             hasAnims = false
  317.             oppr15 = true
  318.             local Ochar = Part.Parent
  319.             local OHRP = Part.Parent.HumanoidRootPart
  320.             local OPlr = nil
  321.             if game.Players:FindFirstChild(Part.Parent.Name) then
  322.                 OPlr = game.Players:WaitForChild(Part.Parent.Name)
  323.             end
  324.             if Part.Parent.PrimaryPart == nil then
  325.                 Part.Parent.PrimaryPart = Part.Parent.Head
  326.             end
  327.             OChar = Part.Parent
  328.             OChar:FindFirstChildWhichIsA("Humanoid").RequiresNeck = false
  329.             if Ochar.Head:FindFirstChild("Neck") then
  330.                 HeadO = motortoweld(Ochar.Head:WaitForChild("Neck"))
  331.                 LArmO = motortoweld(Ochar.LeftUpperArm:WaitForChild("LeftShoulder"))
  332.                 RArmO = motortoweld(Ochar.RightUpperArm:WaitForChild("RightShoulder"))
  333.                 LLegO = motortoweld(Ochar.LeftUpperLeg:WaitForChild("LeftHip"))
  334.                 RLegO = motortoweld(Ochar.RightUpperLeg:WaitForChild("RightHip"))
  335.                 hasAnims = true
  336.             end
  337.  
  338.             if Ochar.LowerTorso:FindFirstChild("Root") then
  339.                 TorsoO = motortoweld(Ochar.LowerTorso:WaitForChild("Root"))
  340.                 hasAnims = true
  341.             end
  342.            
  343.             if hasAnims then
  344.                 HeadO.Parent = Ochar.Head
  345.                 TorsoO.Parent = Ochar.LowerTorso
  346.                 LArmO.Parent = Ochar.LeftUpperArm
  347.                 RArmO.Parent = Ochar.RightUpperArm
  348.                 LLegO.Parent = Ochar.LeftUpperLeg
  349.                 RLegO.Parent = Ochar.RightUpperLeg
  350.                 HeadOS = save(Ochar.Head:WaitForChild("Neck"))
  351.                 TorsoOS = save(Ochar.LowerTorso:WaitForChild("Root"))
  352.                 LArmOS = save(Ochar.LeftUpperArm:WaitForChild("LeftShoulder"))
  353.                 RArmOS = save(Ochar.RightUpperArm:WaitForChild("RightShoulder"))
  354.                 LLegOS = save(Ochar.LeftUpperLeg:WaitForChild("LeftHip"))
  355.                 RLegOS = save(Ochar.RightUpperLeg:WaitForChild("RightHip"))
  356.             end
  357.            
  358.             WeldTogether = Instance.new("Weld")
  359.             WeldTogether.Parent = Char
  360.             WeldTogether.Part0 = OHRP
  361.             WeldTogether.Part1 = HRP
  362.             WeldTogether.Name = "Zuanzale zingel"
  363.            
  364.             local parts = OChar:GetDescendants()
  365.             for i=1, #parts do
  366.                 if parts[i].ClassName == "Part" then
  367.                     parts[i].Massless = true
  368.                 end
  369.             end
  370.            
  371.             grabbing = true
  372.             HRP.Anchored = true
  373.             Char:FindFirstChildWhichIsA("Humanoid").AutoRotate = false
  374.             OChar:FindFirstChildWhichIsA("Humanoid").AutoRotate = false
  375.             OChar:FindFirstChildWhichIsA("Humanoid").PlatformStand = true
  376.             GrabStartr15(OChar)
  377.             wait(1)
  378.             HRP.Anchored = false
  379.             OChar:WaitForChild("HumanoidRootPart").Anchored = false
  380.             Char.Humanoid.AutoRotate = true
  381.             OChar.Humanoid.AutoRotate = true
  382.             OChar.Humanoid.PlatformStand = true
  383.         end
  384.     end
  385. end
Advertisement
Add Comment
Please, Sign In to add comment