vL4d_4eVer

ragdoll

Apr 28th, 2018
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.67 KB | None | 0 0
  1. local plr = game:GetService("Players").LocalPlayer
  2. local mouse = plr:GetMouse()
  3. local rag = NS([[
  4. local remot = Instance.new("RemoteFunction",owner.Character) remot.Name = "aarem"
  5. remot.OnInvoke:connect(function(plr1,keyy)
  6. local char = plr1.Character
  7. local ragd = false
  8. function ragdollc()
  9.     local ded = char
  10.     local h1 = ded:FindFirstChild("Head")
  11.     local t1 = ded:FindFirstChild("Torso") or ded:FindFirstChild("UpperTorso")
  12.     local ra1 = ded:FindFirstChild("Right Arm")
  13.     local la1 = ded:FindFirstChild("Left Arm")
  14.     local rl1 = ded:FindFirstChild("Right Leg")
  15.     local ll1 = ded:FindFirstChild("Left Leg")
  16.     local nec1 = t1:FindFirstChild("Neck")
  17.     local rs1 = t1:FindFirstChild("Right Shoulder")
  18.     local ls1 = t1:FindFirstChild("Left Shoulder")
  19.     local rh1 = t1:FindFirstChild("Right Hip")
  20.     local lh1 = t1:FindFirstChild("Left Hip")
  21.     local hum1 = ded:FindFirstChildOfClass("Humanoid")
  22.     local rut1 = ded:FindFirstChild("HumanoidRootPart")
  23.     for i,v in pairs(ded:GetChildren()) do
  24.         if v:IsA("BasePart") then
  25.             v.Anchored = false
  26.         end
  27.         if v:IsA("Accessory") or v:IsA("Hat") then
  28.             v.Handle.Anchored = false
  29.         end
  30.     end
  31.     kn.Transparency = 1
  32.     hum1.PlatformStand = true
  33.     --//Joints~//--
  34.     --Neck--
  35.     if nec1 ~= nil then
  36.     nec1.Part1 = nil
  37.     local neca = Instance.new("Glue",t1) neca.Part0 = t1 neca.Part1 = h1 neca.C0 = CFrame.new(0,t1.Size.y/2,0) neca.C1 = CFrame.new(0,-h1.Size.y/2,0) neca.Name = "yo"
  38.     local ch = Instance.new("Part",t1) ch.Name = "yo" ch.Size = Vector3.new(h1.Size.x/2,h1.Size.y/2,h1.Size.z/2) ch.TopSurface = "Smooth" ch.BottomSurface = "Smooth" ch.Transparency = 1
  39.     local wh = Instance.new("Weld",ch) wh.Part0 = h1 wh.Part1 = ch
  40.     end
  41.     --Right Arm--
  42.     if rs1 ~= nil then
  43.     rs1.Part1 = nil
  44.     local rsa = Instance.new("Glue",t1) rsa.Part0 = t1 rsa.Part1 = ra1 rsa.C0 = CFrame.new(t1.Size.x/2 + t1.Size.x/4,t1.Size.y/4,0) rsa.C1 = CFrame.new(0,ra1.Size.y/4,0)
  45. rsa.Name = "yo"
  46.     local cra = Instance.new("Part",t1) cra.Name = "yo" cra.Size = Vector3.new(ra1.Size.y/2 + ra1.Size.y/4,ra1.Size.y/2,ra1.Size.z) cra.TopSurface = "Smooth" cra.BottomSurface = "Smooth" cra.Transparency = 1
  47.     local wra = Instance.new("Weld",cra) wra.Part0 = ra1 wra.Part1 = cra wra.C0 = CFrame.new(0,-ra1.Size.y/8,0) * CFrame.Angles(rad(0),rad(0),rad(90))
  48.     end
  49.     --Left Arm--
  50.     if ls1 ~= nil then
  51.     ls1.Part1 = nil
  52.     local lsa = Instance.new("Glue",t1) lsa.Part0 = t1 lsa.Part1 = la1 lsa.C0 = CFrame.new(-t1.Size.x/2 - t1.Size.x/4,t1.Size.y/4,0) lsa.C1 = CFrame.new(0,la1.Size.y/4,0) lsa.Name = "yo"
  53.     local cla = Instance.new("Part",t1) cla.Name = "yo" cla.Size = Vector3.new(la1.Size.y/2 + la1.Size.y/4,la1.Size.y/2,la1.Size.z) cla.TopSurface = "Smooth" cla.BottomSurface = "Smooth" cla.Transparency = 1
  54.     local wla = Instance.new("Weld",cla) wla.Part0 = la1 wla.Part1 = cla wla.C0 = CFrame.new(0,-la1.Size.y/8,0) * CFrame.Angles(rad(0),rad(0),rad(90))
  55.     end
  56.     --Right Leg--
  57.     if rh1 ~= nil then
  58.     rh1.Part1 = nil
  59.     local rha = Instance.new("Glue",t1) rha.Part0 = t1 rha.Part1 = rl1 rha.C0 = CFrame.new(t1.Size.x/4,-t1.Size.y/2,0) rha.C1 = CFrame.new(0,rl1.Size.y/2,0) rha.Name = "yo"
  60.     local crl = Instance.new("Part",t1) crl.Name = "yo" crl.Size = Vector3.new(rl1.Size.y/2 + rl1.Size.y/4,rl1.Size.y/2,rl1.Size.z) crl.TopSurface = "Smooth" crl.BottomSurface = "Smooth" crl.Transparency = 1
  61.     local wrl = Instance.new("Weld",crl) wrl.Part0 = rl1 wrl.Part1 = crl wrl.C0 = CFrame.new(0,-rl1.Size.y/8,0) * CFrame.Angles(rad(0),rad(0),rad(90))
  62.     end
  63.     --Left Leg--
  64.     if lh1 ~= nil then
  65.     lh1.Part1 = nil
  66.     local lha = Instance.new("Glue",t1) lha.Part0 = t1 lha.Part1 = ll1 lha.C0 = CFrame.new(-t1.Size.x/4,-t1.Size.y/2,0) lha.C1 = CFrame.new(0,ll1.Size.y/2,0) lha.Name = "yo"
  67.     local cll = Instance.new("Part",t1) cll.Name = "yo" cll.Size = Vector3.new(ll1.Size.y/2 + ll1.Size.y/4,ll1.Size.y/2,ll1.Size.z) cll.TopSurface = "Smooth" cll.BottomSurface = "Smooth" cll.Transparency = 1
  68.     local wll = Instance.new("Weld",cll) wll.Part0 = ll1 wll.Part1 = cll wll.C0 = CFrame.new(0,-ll1.Size.y/8,0) * CFrame.Angles(rad(0),rad(0),rad(90))
  69.     end
  70.     --//End of Joints~//--
  71.     hum1.PlatformStand = true
  72. end
  73. function unragdollc()
  74.     local ded = char
  75.     local h1 = ded:FindFirstChild("Head")
  76.     local t1 = ded:FindFirstChild("Torso") or ded:FindFirstChild("UpperTorso")
  77.     local ra1 = ded:FindFirstChild("Right Arm")
  78.     local la1 = ded:FindFirstChild("Left Arm")
  79.     local rl1 = ded:FindFirstChild("Right Leg")
  80.     local ll1 = ded:FindFirstChild("Left Leg")
  81.     local nec1 = t1:FindFirstChild("Neck")
  82.     local rs1 = t1:FindFirstChild("Right Shoulder")
  83.     local ls1 = t1:FindFirstChild("Left Shoulder")
  84.     local rh1 = t1:FindFirstChild("Right Hip")
  85.     local lh1 = t1:FindFirstChild("Left Hip")
  86.     local hum1 = ded:FindFirstChildOfClass("Humanoid")
  87.     local rut1 = ded:FindFirstChild("HumanoidRootPart")
  88.     rut1.CFrame = CFrame.new(rut1.CFrame.p,Vector3.new(nil,rut.CFrame.y,rut.CFrame.z)) * CFrame.new(0,2,0)
  89.     kn.Transparency = 0
  90.     for i,v in pairs(ded:GetChildren()) do
  91.         if v:IsA("BasePart") then
  92.             v.Anchored = false
  93.         end
  94.         if v:IsA("Accessory") or v:IsA("Hat") then
  95.             v.Handle.Anchored = false
  96.         end
  97.     end
  98.     for i,v in pairs(t1:GetChildren()) do
  99.     if v.Name == "yo" then
  100.     v:Destroy()
  101.     end
  102.     end
  103.     hum1.PlatformStand = false
  104.     if nec1 ~= nil and h1 ~= nil then
  105.         nec1.Part1 = h1
  106.     end
  107.     if rs1 ~= nil and ra1 ~= nil then
  108.         rs1.Part1 = ra1
  109.     end
  110.     if ls1 ~= nil and la1 ~= nil then
  111.         ls1.Part1 = la1
  112.     end
  113.     if rh1 ~= nil and rl1 ~= nil then
  114.         rh1.Part1 = rl1
  115.     end
  116.     if lh1 ~= nil and ll1 ~= nil then
  117.         lh1.Part1 = ll1
  118.     end
  119. end
  120. function a(key)
  121. if key == "r" and not ragd then
  122.     ragdollc()
  123. elseif key == "r" and ragd then
  124.     unragdollc()
  125. end
  126. end
  127.     a(keyy)
  128. end)
  129. ]],owner.Character)
  130. rem = owner.Character:WaitForChild("aarem")
  131. mouse.KeyDown:connect(function(key)
  132. remot:Invoke(plr,key)
  133. end)
Add Comment
Please, Sign In to add comment