Advertisement
Rufus14

Better Ragdoll Shotgun (REUPLOAD)

May 18th, 2018
1,438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 35.25 KB | None | 0 0
  1. --By Rufus14
  2. mouse = game.Players.LocalPlayer:GetMouse()
  3. --
  4. model = Instance.new("Model", workspace.CurrentCamera)
  5. model.Name = "FPSArms"
  6. local humanoidiiiiiilololololol = Instance.new("Humanoid",  model)
  7. game.Players.LocalPlayer.Character.Archivable = true
  8. rhandclone = game.Players.LocalPlayer.Character["Right Arm"]:Clone()
  9. rhandclone:BreakJoints()
  10. local rhandcloneweld = Instance.new("Weld", rhandclone)
  11. rhandcloneweld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  12. rhandcloneweld.Part1 = rhandclone
  13. rhandcloneweld.C0 = CFrame.new(0,0,0.5)
  14. rhandclone.Parent = model
  15. rhandclone.Transparency = 1
  16. --
  17. lhandclone = game.Players.LocalPlayer.Character["Left Arm"]:Clone()
  18. lhandclone:BreakJoints()
  19. local lhandcloneweld = Instance.new("Weld", lhandclone)
  20. lhandcloneweld.Part0 = game.Players.LocalPlayer.Character["Left Arm"]
  21. lhandcloneweld.Part1 = lhandclone
  22. lhandcloneweld.C0 = CFrame.new(0,0,0.5)
  23. lhandclone.Parent = model
  24. lhandclone.Transparency = 1
  25. --
  26. game.Players.LocalPlayer.Character.Torso.Neck.C1 = CFrame.new(0,-0.7,0)
  27. local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  28. rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  29. rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  30. rhandweld.C1 = CFrame.new(0,1,0)
  31. local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character["Right Arm"])
  32. lhandweld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  33. lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
  34. lhandweld.C0 = CFrame.new(-1.12992668, -1.09744608, 0.0783367157, 0.693704247, -0.719959378, -0.0208011046, 0.719762683, 0.691863716, 0.0571505688, -0.0267545581, -0.0546174534, 0.998148739)
  35. canlo = true
  36. function canloo()
  37.     canlo = false
  38. end
  39. game.Players.LocalPlayer.Character.Humanoid.Died:connect(canloo)
  40. function look()
  41.     if mouse.Target then
  42.         if mouse.Target.Parent ~= "FPSArms" and canlo then
  43.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(mouse.Hit.p.x,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.y,mouse.Hit.p.z))
  44.             rhandweld.C0 = CFrame.new(1.29883623, 0.5, -0.640856385, 0.939692557, 0.342020094, 0, 1.49501727e-08, -4.10752641e-08, -0.99999994, -0.342020124, 0.939692616, -4.37113883e-08) * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
  45.             game.Players.LocalPlayer.Character.Torso.Neck.C0 = CFrame.new(0,0.8,0) * CFrame.fromEulerAnglesXYZ(math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
  46.         end
  47.     else
  48.         if canlo then
  49.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(mouse.Hit.p.x,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.y,mouse.Hit.p.z))
  50.         rhandweld.C0 = CFrame.new(1.29883623, 0.5, -0.640856385, 0.939692557, 0.342020094, 0, 1.49501727e-08, -4.10752641e-08, -0.99999994, -0.342020124, 0.939692616, -4.37113883e-08) * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
  51.         game.Players.LocalPlayer.Character.Torso.Neck.C0 = CFrame.new(0,0.8,0) * CFrame.fromEulerAnglesXYZ(math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0)
  52.         end
  53.     end
  54. end
  55. game:GetService("RunService").RenderStepped:connect(look)
  56. --Converted with ttyyuu12345's model to script plugin v4
  57. function sandbox(var,func)
  58.     local env = getfenv(func)
  59.     local newenv = setmetatable({},{
  60.         __index = function(self,k)
  61.             if k=="script" then
  62.                 return var
  63.             else
  64.                 return env[k]
  65.             end
  66.         end,
  67.     })
  68.     setfenv(func,newenv)
  69.     return func
  70. end
  71. cors = {}
  72. mas = Instance.new("Model",game:GetService("Lighting"))
  73. Part0 = Instance.new("Part")
  74. Sound1 = Instance.new("Sound")
  75. SpecialMesh2 = Instance.new("SpecialMesh")
  76. Part0.Name = "Shotgun"
  77. Part0.Parent = mas
  78. Part0.BrickColor = BrickColor.new("Really black")
  79. Part0.Reflectance = 1
  80. Part0.CanCollide = false
  81. Part0.FormFactor = Enum.FormFactor.Custom
  82. Part0.Size = Vector3.new(0.770000994, 0.930003285, 3.75999236)
  83. Part0.CFrame = CFrame.new(0.730844021, 5.84272289, -1.70900095, 0.999999881, 0, 0, 0, 0.999999881, 0, 0, 0, 0.99999994)
  84. Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  85. Part0.Position = Vector3.new(0.730844021, 5.84272289, -1.70900095)
  86. Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  87. Sound1.Name = "Fire"
  88. Sound1.Parent = Part0
  89. Sound1.SoundId = "rbxassetid://636316879"
  90. Sound1.Volume = 1
  91. SpecialMesh2.Parent = Part0
  92. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=94219391"
  93. SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
  94. SpecialMesh2.TextureId = "rbxassetid://1153072548"
  95. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  96. SpecialMesh2.Scale = Vector3.new(0.75, 0.75, 0.75)
  97. for i,v in pairs(mas:GetChildren()) do
  98.     v.Parent = game:GetService("Players").LocalPlayer.Character
  99.     pcall(function() v:MakeJoints() end)
  100. end
  101. mas:Destroy()
  102. for i,v in pairs(cors) do
  103.     spawn(function()
  104.         pcall(v)
  105.     end)
  106. end
  107. --
  108. function die()
  109.     script:Remove()
  110. end
  111. game.Players.LocalPlayer.Character.Humanoid.Died:connect(die)
  112. gunclone = Part0:Clone()
  113. gunclone:BreakJoints()
  114. gunclone.Transparency = 1
  115. local guncloneweld = Instance.new("Weld", gunclone)
  116. guncloneweld.Part0 = Part0
  117. guncloneweld.Part1 = gunclone
  118. guncloneweld.C0 = CFrame.new(0,-0.5,0)
  119. gunclone.Parent = model
  120. --
  121. Weld0 = Instance.new("Weld", game.Players.LocalPlayer.Character["Right Arm"])
  122. Weld0.C0 = CFrame.new(-0.168411255, -1.19799232, -0.142723083, 0.939692438, 1.49501709e-08, -0.342020094, 0.342020065, -4.10752605e-08, 0.939692557, 0, -0.999999821, -4.37113847e-08)
  123. Weld0.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  124. Weld0.Part1 = Part0
  125. shooting = false
  126. local deflect = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  127. deflect.MaxDistance = 100
  128. deflect.Volume = 10
  129. deflect.SoundId = "rbxassetid://341519743"
  130. deflect.Looped = true
  131. local hitsound = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  132. hitsound.Volume = 10
  133. hitsound.SoundId = "rbxassetid://1489924400"
  134. local hedshot = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  135. hedshot.Volume = 10
  136. hedshot.SoundId = "rbxassetid://147936251"
  137. local wubwub = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  138. wubwub.Volume = 5
  139. wubwub.SoundId = "rbxassetid://425221796"
  140. wubbing = false
  141. function wubing(key)
  142.     key = key:lower()
  143.     if key == "q" then
  144.         if not wubbing then
  145.             wubbing = true
  146.             wubwub:Play()
  147.         else
  148.             wubbing = false
  149.             wubwub:Stop()
  150.         end
  151.     end
  152. end
  153. mouse.KeyDown:connect(wubing)
  154. function shootdemskids()
  155.     if not shooting then
  156.         shooting = true
  157.         Sound1:Play()
  158.         local light = Instance.new("PointLight", Part0)
  159.         light.Brightness = 10
  160.         for i = 1,5 do
  161.             local projectile = Instance.new("Part", workspace)
  162.             local clonede = deflect:Clone()
  163.             clonede.Parent = projectile
  164.             clonede:Play()
  165.             projectile.Size = Vector3.new(0.2,0.2,2.5)
  166.             projectile.CanCollide = false
  167.             projectile.CFrame = Part0.CFrame * CFrame.new(0,0,-4)
  168.             projectile.Material = "Neon"
  169.             projectile.Name = "Bullett"
  170.             projectile.CFrame = CFrame.new(projectile.Position, mouse.Hit.p)
  171.             local vel = Instance.new("BodyVelocity", projectile)
  172.             vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  173.             vel.Velocity = mouse.Hit.lookVector * 1000 + Vector3.new(math.random(-50,50),math.random(-50,50),0)
  174.             game.Debris:AddItem(projectile, 10)
  175.             local function damag(part)
  176.                 if part.Parent:findFirstChild("ragged") then
  177.                     projectile:destroy()
  178.                 end
  179.                 if part.Name ~= "Shotgun" and part.Name ~= "Bullett" then
  180.                     if part.Parent.ClassName == "Accessory" or part.Parent.Parent.ClassName == "Accessory" or part.ClassName == "Accessory" then
  181.                        
  182.                     else
  183.                         projectile:destroy()
  184.                     end
  185.                 end
  186.                 local humanoid = part.Parent:findFirstChildOfClass("Humanoid")
  187.                 if humanoid then
  188.                     if humanoid.Parent:findFirstChild("ragged") then
  189.                         projectile:Remove()
  190.                     end
  191.                 end
  192.                 if humanoid and part.Name ~= "Shotgun" and part.Name ~= "Bullett" and humanoid.Parent:findFirstChild("ragged") == nil then
  193.                     local damage = math.random(20,40)
  194.                     if part.Name == "Head" then
  195.                         hedshot:Play()
  196.                                 humanoid.Parent.Head.Transparency = 1
  197.                                 for i,v in pairs(humanoid.Parent:GetChildren()) do
  198.                                     if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  199.                                         local handle = v:findFirstChild("Handle")
  200.                                         if handle then
  201.                                             handle.Transparency = 1
  202.                                         end
  203.                                     end
  204.                                 end
  205.                                 for i,v in pairs(humanoid.Parent.Head:GetChildren()) do
  206.                                     if v.ClassName == "Decal" then
  207.                                         v:destroy()
  208.                                     end
  209.                                 end
  210.                                 humanoid.Health = 0
  211.                             end
  212.                     if humanoid.Health <= damage then
  213.                         local ragdolled = Instance.new("BoolValue", humanoid.Parent)
  214.                         ragdolled.Name = "ragged"
  215.                         local uppertorso = humanoid.Parent:findFirstChild("UpperTorso")
  216.                         if uppertorso then
  217.                             humanoid.Parent:BreakJoints()
  218.                             while humanoid.Health >= 0.000000000001 do
  219.                                 game:GetService("RunService").RenderStepped:wait()
  220.                             end
  221.                             if humanoid.Parent:findFirstChild("HumanoidRootPart") then
  222.                                 humanoid.Parent.HumanoidRootPart.CanCollide = false
  223.                             end
  224.                             local function makeballlimb(attachone, attachtwo, upperang, lowang, twist)
  225.                                 local constraint = Instance.new("BallSocketConstraint", humanoid.Parent)
  226.                                 constraint.Attachment0 = attachone
  227.                                 constraint.Attachment1 = attachtwo
  228.                                 constraint.LimitsEnabled = true
  229.                                 constraint.TwistLimitsEnabled = true
  230.                                 constraint.TwistLowerAngle = lowang
  231.                                 constraint.TwistUpperAngle = upperang
  232.                                 constraint.UpperAngle = twist
  233.                             end
  234.                             local function makehingelimb(attachone, attachtwo, upperang, lowang)
  235.                                 local constraint = Instance.new("HingeConstraint", humanoid.Parent)
  236.                                 constraint.Attachment0 = attachone
  237.                                 constraint.Attachment1 = attachtwo
  238.                                 constraint.LimitsEnabled = true
  239.                                 constraint.LowerAngle = lowang
  240.                                 constraint.UpperAngle = upperang
  241.                             end
  242.                             for i,v in pairs(humanoid.Parent:GetChildren()) do --scan player
  243.                                 if v.ClassName == "Accessory" then
  244.                                     local findhandle = v:findFirstChild("Handle") --finding handle in accesorry
  245.                                     if findhandle then
  246.                                         local attach = findhandle:findFirstChildOfClass("Attachment")
  247.                                         for q,w in pairs(humanoid.Parent:GetChildren()) do --scan player
  248.                                             if w.Name == "UpperTorso" or w.Name == "Head" then
  249.                                                 attach1 = w:findFirstChild(attach.Name) --finding attachment in head/uppertorso
  250.                                             end
  251.                                         end
  252.                                         if attach and attach1 then
  253.                                             local constraint = Instance.new("HingeConstraint", humanoid.Parent) --making fake weld
  254.                                             constraint.Attachment0 = attach
  255.                                             constraint.Attachment1 = attach1
  256.                                             constraint.LimitsEnabled = true
  257.                                             constraint.LowerAngle = 0
  258.                                             constraint.UpperAngle = 0
  259.                                         end
  260.                                     end
  261.                                 end
  262.                             end
  263.                             if humanoid.Parent:findFirstChild("Head") and humanoid.Parent:findFirstChild("UpperTorso") then
  264.                                         local attachment = Instance.new("Attachment", humanoid.Parent.Head)
  265.                                         attachment.Position = Vector3.new(0, -0.5, 0)
  266.                                         attachment.Name = "lol"
  267.                                         attachment.Visible = false
  268.                                         humanoid.Parent.UpperTorso.NeckAttachment.Visible = false
  269.                                         humanoid.Parent.UpperTorso.NeckAttachment.Position = humanoid.Parent.UpperTorso.NeckAttachment.Position + Vector3.new(0,0,0)
  270.                                         local ball = Instance.new("BallSocketConstraint", humanoid.Parent)
  271.                                         ball.Attachment0 = humanoid.Parent.UpperTorso.NeckAttachment
  272.                                         ball.Attachment1 = attachment
  273.                                         ball.LimitsEnabled = true
  274.                                         ball.TwistLimitsEnabled = true
  275.                                         ball.UpperAngle = 40
  276.                                         ball.Restitution = 0.5
  277.                                         ball.TwistUpperAngle = 40
  278.                                         ball.TwistLowerAngle = -40
  279.                                         local  collidepartofleftleg = Instance.new("Part", humanoid.Parent.UpperTorso)
  280.                                         collidepartofleftleg.Name = "Bone"
  281.                                         collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7)
  282.                                         collidepartofleftleg.Transparency = 1
  283.                                         collidepartofleftleg:BreakJoints()
  284.                                         local weeld = Instance.new("Weld", collidepartofleftleg)
  285.                                         weeld.Part0 = collidepartofleftleg
  286.                                         weeld.Part1 = humanoid.Parent["Head"]
  287.                                         if humanoid.Parent.Head:findFirstChild("Neck") then
  288.                                             humanoid.Parent.Head.Neck:destroy()
  289.                                         end
  290.                                         if humanoid.Parent.Head:findFirstChild("face") then
  291.                                             humanoid.Parent.Head.face.Texture = "http://www.roblox.com/asset/?id=810245460"
  292.                                         end
  293.                             end
  294.                             local LeftUpperLeg = humanoid.Parent:findFirstChild("LeftUpperLeg")
  295.                             local LeftLowerLeg = humanoid.Parent:findFirstChild("LeftLowerLeg")
  296.                             --
  297.                             local RightUpperLeg = humanoid.Parent:findFirstChild("RightUpperLeg")
  298.                             local RightLowerLeg = humanoid.Parent:findFirstChild("RightLowerLeg")
  299.                             --
  300.                             local RightUpperArm = humanoid.Parent:findFirstChild("RightUpperArm")
  301.                             local RightLowerArm = humanoid.Parent:findFirstChild("RightLowerArm")
  302.                             --
  303.                             local LeftUpperArm = humanoid.Parent:findFirstChild("LeftUpperArm")
  304.                             local LeftLowerArm = humanoid.Parent:findFirstChild("LeftLowerArm")
  305.                             --Foot & Hands--
  306.                            
  307.                             local LeftFoot = humanoid.Parent:findFirstChild("LeftFoot")
  308.                             local RightFoot = humanoid.Parent:findFirstChild("RightFoot")
  309.                             --
  310.                             local LeftHand = humanoid.Parent:findFirstChild("LeftHand")
  311.                             local RightHand = humanoid.Parent:findFirstChild("RightHand")
  312.                            
  313.                             --END--
  314.                             --TORSOS--
  315.                            
  316.                             local UpperTorso = humanoid.Parent:findFirstChild("UpperTorso")
  317.                             local LowerTorso = humanoid.Parent:findFirstChild("LowerTorso")
  318.                            
  319.                             --END--
  320.                             local function search(datone)
  321.                                 for i,v in pairs(datone:GetChildren()) do
  322.                                     search(v)
  323.                                     if v.ClassName == "Sound" then
  324.                                         v.Volume = 0
  325.                                     end
  326.                                 end
  327.                             end
  328.                             search(humanoid.Parent)
  329.                             local clonede = hitsound:Clone()
  330.                             clonede.Parent = part
  331.                             clonede:Play()
  332.                             if part.Name == "Head" then
  333.                                 humanoid.Parent.Head.Transparency = 1
  334.                                 for i,v in pairs(humanoid.Parent:GetChildren()) do
  335.                                     if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  336.                                         local handle = v:findFirstChild("Handle")
  337.                                         if handle then
  338.                                             handle.Transparency = 1
  339.                                         end
  340.                                     end
  341.                                 end
  342.                                 for i,v in pairs(humanoid.Parent.Head:GetChildren()) do
  343.                                     if v.ClassName == "Decal" then
  344.                                         v:destroy()
  345.                                     end
  346.                                 end
  347.                                 humanoid.Parent:BreakJoints()
  348.                             end
  349.                             if LowerTorso then
  350.                                 if LeftUpperLeg then
  351.                                     local function uncollidee()
  352.                                         LeftUpperLeg.CanCollide = false
  353.                                     end
  354.                                     game:GetService("RunService").Stepped:connect(uncollidee)
  355.                                     makeballlimb(LowerTorso["LeftHipRigAttachment"], LeftUpperLeg["LeftHipRigAttachment"], 50,-50, 90)
  356.                                 end
  357.                                 if RightUpperLeg then
  358.                                     local function uncollidee()
  359.                                         RightUpperLeg.CanCollide = false
  360.                                     end
  361.                                     game:GetService("RunService").Stepped:connect(uncollidee)
  362.                                     makeballlimb(LowerTorso["RightHipRigAttachment"], RightUpperLeg["RightHipRigAttachment"], 50,-50, 90)
  363.                                 end
  364.                                 if LeftLowerLeg then
  365.                                     makehingelimb(LeftUpperLeg["LeftKneeRigAttachment"], LeftLowerLeg["LeftKneeRigAttachment"], 0,-90)
  366.                                 end
  367.                                 if RightLowerLeg then
  368.                                     makehingelimb(RightUpperLeg["RightKneeRigAttachment"], RightLowerLeg["RightKneeRigAttachment"], 0,-90)
  369.                                 end
  370.                                 if LeftFoot then
  371.                                     makehingelimb(LeftLowerLeg["LeftAnkleRigAttachment"], LeftFoot["LeftAnkleRigAttachment"], 30, -30)
  372.                                 end
  373.                                 if RightFoot then
  374.                                     makehingelimb(RightLowerLeg["RightAnkleRigAttachment"], RightFoot["RightAnkleRigAttachment"], 30, -30)
  375.                                 end
  376.                                 if UpperTorso then
  377.                                     makehingelimb(UpperTorso["WaistRigAttachment"], LowerTorso["WaistRigAttachment"], 30, -30)
  378.                                 end
  379.                             end
  380.                             if UpperTorso then
  381.                                 local vel = Instance.new("BodyVelocity", UpperTorso)
  382.                                 vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  383.                                 vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 10
  384.                                 game.Debris:AddItem(vel, 0.1)
  385.                                 local canhit = true
  386.                                 local hitval = 15
  387.                                 local uptor = humanoid.Parent.UpperTorso
  388.                                 if RightUpperArm then
  389.                                     local function uncollidee()
  390.                                         RightUpperArm.CanCollide = false
  391.                                     end
  392.                                     game:GetService("RunService").Stepped:connect(uncollidee)
  393.                                     makeballlimb(RightUpperArm["RightShoulderRigAttachment"], UpperTorso["RightShoulderRigAttachment"], 90,-50, 180)
  394.                                 end
  395.                                 if RightLowerArm then
  396.                                     makehingelimb(RightLowerArm["RightElbowRigAttachment"], RightUpperArm["RightElbowRigAttachment"], 0,-90)
  397.                                 end
  398.                                 if RightHand then
  399.                                     makehingelimb(RightHand["RightWristRigAttachment"], RightLowerArm["RightWristRigAttachment"], 30,30)
  400.                                 end
  401.                                 if LeftUpperArm then
  402.                                     local function uncollidee()
  403.                                         LeftUpperArm.CanCollide = false
  404.                                     end
  405.                                     game:GetService("RunService").Stepped:connect(uncollidee)
  406.                                     makeballlimb(LeftUpperArm["LeftShoulderRigAttachment"], UpperTorso["LeftShoulderRigAttachment"], 90,-50, 180)
  407.                                 end
  408.                                 if LeftLowerArm then
  409.                                     makehingelimb(LeftLowerArm["LeftElbowRigAttachment"], LeftUpperArm["LeftElbowRigAttachment"], 0,-90)
  410.                                 end
  411.                                 if LeftHand then
  412.                                     makehingelimb(LeftHand["LeftWristRigAttachment"], LeftLowerArm["LeftWristRigAttachment"], 30,30)
  413.                                 end
  414.                             end
  415.                         elseif humanoid.Parent:findFirstChild("Torso") then
  416.                             humanoid.Parent.Archivable = true
  417.                             humanoid.PlatformStand = true
  418.                             local function search(datone)
  419.                                 for i,v in pairs(datone:GetChildren()) do
  420.                                     search(v)
  421.                                     if v.ClassName == "Sound" then
  422.                                         v.Volume = 0
  423.                                     end
  424.                                 end
  425.                             end
  426.                             search(humanoid.Parent)
  427.                             local clonede = hitsound:Clone()
  428.                             clonede.Parent = part
  429.                             clonede:Play()
  430.                             if part.Name == "Head" then
  431.                                 humanoid.Parent.Head.Transparency = 1
  432.                                 for i,v in pairs(humanoid.Parent:GetChildren()) do
  433.                                     if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  434.                                         local handle = v:findFirstChild("Handle")
  435.                                         if handle then
  436.                                             handle.Transparency = 1
  437.                                         end
  438.                                     end
  439.                                 end
  440.                                 for i,v in pairs(humanoid.Parent.Head:GetChildren()) do
  441.                                     if v.ClassName == "Decal" then
  442.                                         v:destroy()
  443.                                     end
  444.                                 end
  445.                                 humanoid.Parent:BreakJoints()
  446.                             end
  447.                             local clone = humanoid.Parent:Clone()
  448.                             clone.Parent = workspace
  449.                             game.Debris:AddItem(clone, 60)
  450.                             for i,v in pairs(clone:GetChildren()) do
  451.                                 if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  452.                                     v:Remove()
  453.                                 end
  454.                                 for i,p in pairs(v:GetChildren()) do
  455.                                 if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
  456.                                     p:Remove()
  457.                                 end
  458.                             end
  459.                             end
  460.                             for i,t in pairs(humanoid.Parent:GetChildren()) do
  461.                                 if t.ClassName == "Accessory" or t.ClassName == "ForceField" then
  462.                                     t:Remove()
  463.                                 end
  464.                             end
  465.                             local vel = Instance.new("BodyVelocity", clone.Torso)
  466.                             vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  467.                             vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 15
  468.                             game.Debris:AddItem(vel, 0.1)
  469.                             vel = Instance.new("BodyVelocity", clone.Torso)
  470.                             vel.Velocity = clone.Torso.CFrame.lookVector * -5
  471.                             vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  472.                             using = false
  473.                             hit = Instance.new("Sound", clone.Torso)
  474.                             hit.SoundId = "rbxassetid://260430060"
  475.                             hit.Volume = 0
  476.                             hit1 = Instance.new("Sound", clone.Torso)
  477.                             hit1.SoundId = "rbxassetid://138087186"
  478.                             hit1.Volume = 0
  479.                             hit2 = Instance.new("Sound", clone.Torso)
  480.                             hit2.SoundId = "rbxassetid://131237241"
  481.                             hit2.Volume = 0
  482.                             hit3 = Instance.new("Sound", clone.Torso)
  483.                             hit3.SoundId = "rbxassetid://278062209"
  484.                             hit3.Volume = 0
  485.                             hit3.TimePosition = 0.33
  486.                             ded = Instance.new("Sound", clone.Torso)
  487.                             ded.SoundId = "rbxassetid://418892870"
  488.                             ded.Volume = 0
  489.                             local leftarm = clone:findFirstChild("Left Arm")
  490.                             local rightrm = clone:findFirstChild("Right Arm")
  491.                             local leftleg = clone:findFirstChild("Left Leg")
  492.                             local rightleg = clone:findFirstChild("Right Leg")
  493.                             local head = clone:findFirstChild("Head")
  494.                             for i, g in pairs(humanoid.Parent:GetChildren()) do
  495.                                 if g.ClassName == "Part" then
  496.                                     g:destroy()
  497.                                 end
  498.                             end
  499.                             for i, h in pairs(humanoid.Parent:GetChildren()) do
  500.                                 if h.ClassName == "Accesory" then
  501.                                     h:destroy()
  502.                                 end
  503.                             end
  504.                             for z,x in pairs(clone:GetChildren()) do
  505.                                     if x.ClassName == "Accessory" then
  506.                                         local handle = x:findFirstChild("Handle")
  507.                                         if handle then
  508.                                             local attachment = handle:findFirstChildOfClass("Attachment")
  509.                                             if attachment then
  510.                                                 for q,w in pairs(clone:GetChildren()) do
  511.                                                     if w.Name == "Torso" or w.Name == "Head" then
  512.                                                         local anotherone = w:findFirstChild(attachment.Name)
  513.                                                         if attachment and anotherone then
  514.                                                             local constraint = Instance.new("HingeConstraint", clone) --making fake weld
  515.                                                             constraint.Attachment0 = attachment
  516.                                                             constraint.Attachment1 = anotherone
  517.                                                             constraint.LimitsEnabled = true
  518.                                                             constraint.LowerAngle = 0
  519.                                                             constraint.UpperAngle = 0
  520.                                                         end
  521.                                                     end
  522.                                                 end
  523.                                             end
  524.                                         end
  525.                                     end
  526.                                 end
  527.                             if head and clone.Torso:findFirstChild("NeckAttachment") then
  528.                                         local attachment = Instance.new("Attachment", clone.Head)
  529.                                         attachment.Position = Vector3.new(0, -0.5, 0)
  530.                                         attachment.Name = "lol"
  531.                                         attachment.Visible = false
  532.                                         clone.Torso.NeckAttachment.Visible = false
  533.                                         clone.Torso.NeckAttachment.Position = clone.Torso.NeckAttachment.Position + Vector3.new(0,0,0)
  534.                                         local ball = Instance.new("BallSocketConstraint", clone)
  535.                                         ball.Attachment0 = clone.Torso.NeckAttachment
  536.                                         ball.Attachment1 = attachment
  537.                                         ball.LimitsEnabled = true
  538.                                         ball.TwistLimitsEnabled = true
  539.                                         ball.UpperAngle = 90
  540.                                         ball.Restitution = 0.5
  541.                                         ball.TwistUpperAngle = 90
  542.                                         ball.TwistLowerAngle = -90
  543.                                         local  collidepartofleftleg = Instance.new("Part", clone.Torso)
  544.                                         collidepartofleftleg.Name = "Bone"
  545.                                         collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7)
  546.                                         collidepartofleftleg.Transparency = 1
  547.                                         collidepartofleftleg:BreakJoints()
  548.                                         local weeld = Instance.new("Weld", collidepartofleftleg)
  549.                                         weeld.Part0 = collidepartofleftleg
  550.                                         weeld.Part1 = clone["Head"]
  551.                                     end
  552.                             if leftleg ~= nil then
  553.                             leftleg:BreakJoints()
  554.                             local glue = Instance.new("Glue", clone.Torso)
  555.                             glue.Part0 = clone.Torso
  556.                             glue.Part1 = leftleg
  557.                             glue.Name = "Left leg"
  558.                             local collider = Instance.new("Part", leftleg)
  559.                             collider.Position = Vector3.new(0,999,0)
  560.                             collider.Size = Vector3.new(1.5, 1, 1)
  561.                             collider.Shape = "Cylinder"
  562.                             local weld = Instance.new("Weld", collider)
  563.                             weld.Part0 = leftleg
  564.                             weld.Part1 = collider
  565.                             weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  566.                             collider.TopSurface = "Smooth"
  567.                             collider.BottomSurface = "Smooth"
  568.                             collider.formFactor = "Symmetric"
  569.                             glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  570.                             glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  571.                             collider.Transparency = 1
  572.                             end
  573.                             ------------
  574.                             if rightleg ~= nil then
  575.                             rightleg:BreakJoints()
  576.                             local glue1 = Instance.new("Glue", clone.Torso)
  577.                             glue1.Part0 = clone.Torso
  578.                             glue1.Part1 = rightleg
  579.                             glue1.Name = "Right leg"
  580.                             local collider1 = Instance.new("Part", rightleg)
  581.                             collider1.Position = Vector3.new(0,999,0)
  582.                             collider1.Size = Vector3.new(1.5, 1, 1)
  583.                             collider1.Shape = "Cylinder"
  584.                             local weld1 = Instance.new("Weld", collider1)
  585.                             weld1.Part0 = rightleg
  586.                             weld1.Part1 = collider1
  587.                             weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  588.                             collider1.TopSurface = "Smooth"
  589.                             collider1.BottomSurface = "Smooth"
  590.                             collider1.formFactor = "Symmetric"
  591.                             glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  592.                             glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  593.                             collider1.Transparency = 1
  594.                             end
  595.                             ------------
  596.                             if rightrm ~= nil then
  597.                             rightrm:BreakJoints()
  598.                             rightrm.CFrame = clone.Torso.CFrame * CFrame.new(1.7,0,0)
  599.                             local glue11 = Instance.new("Glue", clone.Torso)
  600.                             glue11.Part0 = clone.Torso
  601.                             glue11.Part1 = rightrm
  602.                             glue11.Name = "Right shoulder"
  603.                             local collider11 = Instance.new("Part", rightrm)
  604.                             collider11.Position = Vector3.new(0,9999,0)
  605.                             collider11.Size = Vector3.new(1.5,1,1)
  606.                             collider11.Shape = "Cylinder"
  607.                             local weld11 = Instance.new("Weld", collider11)
  608.                             weld11.Part0 = rightrm
  609.                             weld11.Part1 = collider11
  610.                             weld11.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  611.                             collider11.TopSurface = "Smooth"
  612.                             collider11.BottomSurface = "Smooth"
  613.                             collider11.formFactor = "Symmetric"
  614.                             glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  615.                             glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  616.                             collider11.Transparency = 1
  617.                             end
  618.                             ------------
  619.                             if leftarm ~= nil then
  620.                             leftarm.CFrame = clone.Torso.CFrame * CFrame.new(-1.7,0,0)
  621.                             leftarm:BreakJoints()
  622.                             local glue111 = Instance.new("Glue", clone.Torso)
  623.                             glue111.Part0 = clone.Torso
  624.                             glue111.Part1 = leftarm
  625.                             glue111.Name = "Left shoulder"
  626.                             local collider111 = Instance.new("Part", leftarm)
  627.                             collider111.Position = Vector3.new(0,9999,0)
  628.                             collider111.Size = Vector3.new(1.5,1,1)
  629.                             collider111.Shape = "Cylinder"
  630.                             local weld111 = Instance.new("Weld", collider111)
  631.                             weld111.Part0 = leftarm
  632.                             weld111.Part1 = collider111
  633.                             weld111.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  634.                             collider111.TopSurface = "Smooth"
  635.                             collider111.BottomSurface = "Smooth"
  636.                             collider111.formFactor = "Symmetric"
  637.                             glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  638.                             glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  639.                             collider111.Transparency = 1
  640.                             ----------------
  641.                             sensoring = Instance.new("Part", clone.Torso)
  642.                             sensoring.Size = Vector3.new(1.2,1.1,0.8)
  643.                             sensoring.CanCollide = false
  644.                             sensoring.Position = clone.Torso.Position
  645.                             local welder = Instance.new("Weld", sensoring)
  646.                             welder.Part0 = clone.Torso
  647.                             welder.Part1 = sensoring
  648.                             welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  649.                             sensoring.Transparency = 1
  650.                             -----------------
  651.                             sensoring1 = Instance.new("Part", clone.Torso)
  652.                             sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  653.                             sensoring1.CanCollide = false
  654.                             sensoring1.Position = clone.Torso.Position
  655.                             local welder1 = Instance.new("Weld", sensoring)
  656.                             welder1.Part0 = clone.Torso
  657.                             welder1.Part1 = sensoring1
  658.                             welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  659.                             sensoring1.Transparency = 1
  660.                             end
  661.                             local mathname = math.random(1,10)
  662.                             if mathname == 1 then
  663.                                 clone.Name = humanoid.Parent.Name.." (Shot to death by "..game.Players.LocalPlayer.Name..")"
  664.                             end
  665.                             if mathname == 2 then
  666.                                 clone.Name = humanoid.Parent.Name.." (Killed by "..game.Players.LocalPlayer.Name..")"
  667.                             end
  668.                             if mathname == 3 then
  669.                                 clone.Name = humanoid.Parent.Name.." (Shot by "..game.Players.LocalPlayer.Name..")"
  670.                             end
  671.                             if mathname == 4 then
  672.                                 clone.Name = humanoid.Parent.Name.." (Rekted by "..game.Players.LocalPlayer.Name..")"
  673.                             end
  674.                             if mathname == 5 then
  675.                                 clone.Name = humanoid.Parent.Name.." (rip by "..game.Players.LocalPlayer.Name..")"
  676.                             end
  677.                             if mathname == 6 then
  678.                                 clone.Name = humanoid.Parent.Name.." (rest in piss "..humanoid.Parent.Name.." by "..game.Players.LocalPlayer.Name..")"
  679.                             end
  680.                             if mathname == 7 then
  681.                                 clone.Name = humanoid.Parent.Name.." (rip in pepperoni "..humanoid.Parent.Name.." by "..game.Players.LocalPlayer.Name..")"
  682.                             end
  683.                             if mathname == 8 then
  684.                                 clone.Name = humanoid.Parent.Name.." (uuhhh.wav'd by "..game.Players.LocalPlayer.Name..")"
  685.                             end
  686.                             if mathname == 9 then
  687.                                 clone.Name = humanoid.Parent.Name.." (oof'd by "..game.Players.LocalPlayer.Name..")"
  688.                             end
  689.                             if mathname == 10 then
  690.                                 clone.Name = humanoid.Parent.Name.." (insert child hurt sound by "..game.Players.LocalPlayer.Name..")"
  691.                             end
  692.                             ded:Play()
  693.                             vel:destroy()
  694.                             wait(0.5)
  695.                             local function touch()
  696.                                 if not using then
  697.                                     using = true
  698.                                     local Math = math.random(1,4)
  699.                                     if Math == 1 then
  700.                                         hit:Play()
  701.                                     end
  702.                                     if Math == 2 then
  703.                                         hit1:Play()
  704.                                     end
  705.                                     if Math == 3 then
  706.                                         hit2:Play()
  707.                                     end
  708.                                     if Math == 4 then
  709.                                         hit3:Play()
  710.                                     end
  711.                                     wait(0.1)
  712.                                     using = false
  713.                                 end
  714.                             end
  715.                             sensoring.Touched:connect(touch)
  716.                             sensoring1.Touched:connect(touch)
  717.                             while true do
  718.                                 if clone:findFirstChild("Head") then
  719.                                     clone.Head.CanCollide = false
  720.                                 end
  721.                                 game:GetService("RunService").Stepped:wait()
  722.                             end
  723.                         end
  724.                     else
  725.                         local clonede = hitsound:Clone()
  726.                         clonede.Parent = part
  727.                         clonede:Play()
  728.                         humanoid.Health = humanoid.Health - damage
  729.                     end
  730.                 end
  731.             end
  732.             projectile.Touched:connect(damag)
  733.         end
  734.         for i = 1,5 do
  735.             rhandweld.C1 = rhandweld.C1 * CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(-0.04,0,0)
  736.             game:GetService("RunService").RenderStepped:wait()
  737.         end
  738.         light:destroy()
  739.         for i = 1,10 do
  740.             rhandweld.C1 = rhandweld.C1 * CFrame.new(0,0.1,0) * CFrame.fromEulerAnglesXYZ(0.02,0,0)
  741.             game:GetService("RunService").RenderStepped:wait()
  742.         end
  743.         rhandweld.C1 = CFrame.new(0,1,0)
  744.         shooting = false
  745.     end
  746. end
  747. mouse.Button1Down:connect(shootdemskids)
  748. while true do
  749.     if (workspace.CurrentCamera.CFrame.p - game.Players.LocalPlayer.Character.Head.Position).magnitude < 2 then
  750.         gunclone.Transparency = 0
  751.         rhandclone.Transparency = 0
  752.         lhandclone.Transparency = 0
  753.     else
  754.         gunclone.Transparency = 1
  755.         rhandclone.Transparency = 1
  756.         lhandclone.Transparency = 1
  757.     end
  758.     if Sound1.Parent == nil then
  759.         Sound1.Parent = Part0
  760.     end
  761.     if deflect.Parent == nil then
  762.         deflect.Parent = Part0
  763.     end
  764.     if hitsound.Parent == nil then
  765.         hitsound.Parent = Part0
  766.     end
  767.     if hedshot.Parent == nil then
  768.         hedshot.Parent = Part0
  769.     end
  770.     if wubwub.Parent == nil then
  771.         wubwub.Parent = Part0
  772.     end
  773.     game:GetService("RunService").RenderStepped:wait()
  774. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement