Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function limb_collide(obj,mode)
- if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- --
- local t = {}
- --
- local cb = Instance.new("Part")
- cb.Name = 'limb'
- cb.Transparency = 1
- cb.CanCollide = true
- cb.Anchored = false
- cb.CFrame = obj.CFrame
- cb.Size = obj.Size
- cb.Massless = true
- cb.Locked = true
- game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = cb
- weld.Part1 = obj
- weld.Parent = cb
- obj.Massless = true
- obj.Anchored = false
- if mode or obj:FindFirstChild("Dismembered") then
- cb.Parent = obj -- .Parent
- else
- cb.Parent = script
- table.insert(t,1,cb)
- end
- --
- if not string.match(obj.Name:lower(),'torso') and not string.match(obj.Name:lower(),'rootpart') and not string.match(obj.Name:lower(),'head') then
- local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
- local cb2 = Instance.new("Part")
- cb2.Name = 'limb'
- cb2.Transparency = 1
- cb2.CanCollide = true
- cb2.Anchored = false
- cb2.CFrame = obj.CFrame
- cb2.Size = lv
- cb2.Massless = true
- cb2.Locked = true
- local weld2 = Instance.new("Weld")
- weld2.Part0 = cb
- weld2.Part1 = cb2
- weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
- weld2.Parent = cb2
- if mode or obj:FindFirstChild("Dismembered") then
- cb2.Parent = obj -- .Parent
- else
- cb2.Parent = script
- table.insert(t,1,cb2)
- end
- end
- --
- return t
- end
- function Ragdoll(targchar,headless,insta,kill)
- local pc = targchar
- local targhum = pc:FindFirstChild("Humanoid")
- local js,js2 = {},{}
- for _,obj in pairs(pc:GetDescendants()) do
- if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
- obj.Massless = true
- obj.Locked = true
- end
- end
- if kill == true then
- pc.Archivable = true
- local old_pc = pc
- pc = pc:Clone()
- for i,v in pairs(pc:GetDescendants()) do
- limb_collide(v,true)
- if v:IsA("ParticleEmitter") then
- v.Enabled = false
- end
- if v:IsA("SelectionBox") or v:IsA("BodyVelocity") or v:IsA("BodyPosition") or v:IsA("BodyAngularVelocity") or v:IsA("BodyForce") or v:IsA("BodyGyro") or v:IsA("BodyThrust") or v:IsA("BodyMover") then
- if v:IsA("BodyVelocity") then
- game:GetService("Debris"):AddItem(v,0.15)
- else
- v:Destroy()
- end
- end
- if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
- v:Destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = false
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- for i,v in pairs(old_pc:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("ForceField") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") or v:IsA("SurfaceGui") then
- v:destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = true
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- pc.Parent = workspace
- game:GetService("Debris"):AddItem(pc,30)
- end
- --if kill and targhum:FindFirstChild("Ragdolled") then return; end;
- if pc ~= nil then
- local hum = pc:FindFirstChild'Humanoid'
- local LArm = pc:FindFirstChild'Left Arm'
- local RArm = pc:FindFirstChild'Right Arm'
- local LLeg = pc:FindFirstChild'Left Leg'
- local RLeg = pc:FindFirstChild'Right Leg'
- local torso = pc:FindFirstChild'Torso'
- local head = pc:FindFirstChild'Head'
- local LUA = pc:FindFirstChild'LeftUpperArm'
- local LLA = pc:FindFirstChild'LeftLowerArm'
- local LH = pc:FindFirstChild'LeftHand'
- local RUA = pc:FindFirstChild'RightUpperArm'
- local RLA = pc:FindFirstChild'RightLowerArm'
- local RH = pc:FindFirstChild'RightHand'
- local LUL = pc:FindFirstChild'LeftUpperLeg'
- local LLL = pc:FindFirstChild'LeftLowerLeg'
- local LF = pc:FindFirstChild'LeftFoot'
- local RUL = pc:FindFirstChild'RightUpperLeg'
- local RLL = pc:FindFirstChild'RightLowerLeg'
- local RF = pc:FindFirstChild'RightFoot'
- local UT = pc:FindFirstChild'UpperTorso'
- local LT = pc:FindFirstChild'LowerTorso'
- if hum and LArm and RArm and LLeg and RLeg and head then
- hum.BreakJointsOnDeath = false
- if insta then
- if hum.RigType==Enum.HumanoidRigType.R6 then
- for _,v in pairs(torso:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LArm and not LArm:FindFirstChild('Dismembered') then
- local at1 = Instance.new("Attachment")
- at1.Parent = torso
- at1.Visible = vis
- at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
- at1.Position = Vector3.new(-1,1,0)
- local at1p2 = Instance.new("Attachment")
- at1p2.Parent = LArm
- at1p2.Visible = vis
- at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
- at1p2.Position = Vector3.new(.5,1,0)
- local bis = Instance.new("BallSocketConstraint")
- bis.Parent = LArm
- bis.Attachment0 = at1
- bis.Attachment1 = at1p2
- bis.LimitsEnabled = true
- bis.UpperAngle = 15
- bis.Visible = vis2
- bis.TwistLimitsEnabled = true
- bis.UpperAngle = -45
- bis.TwistLowerAngle = -45
- table.insert(js,1,bis)
- end
- if RArm and not RArm:FindFirstChild('Dismembered') then
- local at2 = Instance.new("Attachment")
- at2.Parent = torso
- at2.Visible = vis
- at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
- at2.Position = Vector3.new(1,1,0)
- local at2p2 = Instance.new("Attachment")
- at2p2.Parent = RArm
- at2p2.Visible = vis
- at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
- at2p2.Position = Vector3.new(-.5,1,0)
- local bis2 = Instance.new("BallSocketConstraint")
- bis2.Parent = RArm
- bis2.Attachment0 = at2
- bis2.Attachment1 = at2p2
- bis2.LimitsEnabled = true
- bis2.UpperAngle = 15
- bis2.Visible = vis2
- bis2.TwistLimitsEnabled = true
- bis2.UpperAngle = -45
- bis2.TwistLowerAngle = -45
- table.insert(js,1,bis2)
- end
- if RLeg and not RLeg:FindFirstChild('Dismembered') then
- local at3 = Instance.new("Attachment")
- at3.Parent = torso
- at3.Visible = vis
- at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at3.Position = Vector3.new(.5,-1,0)
- local at3p2 = Instance.new("Attachment")
- at3p2.Parent = RLeg
- at3p2.Visible = vis
- at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
- at3p2.Position = Vector3.new(0,1,0)
- local bis3 = Instance.new("BallSocketConstraint")
- bis3.Parent = RLeg
- bis3.Attachment0 = at3
- bis3.Attachment1 = at3p2
- bis3.LimitsEnabled = true
- bis3.UpperAngle = 180-15
- bis3.Visible = vis2
- table.insert(js,1,bis3)
- end
- if LLeg and not LLeg:FindFirstChild('Dismembered') then
- local at4 = Instance.new("Attachment")
- at4.Parent = torso
- at4.Visible = vis
- at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at4.Position = Vector3.new(-.5,-1,0)
- local at4p2 = Instance.new("Attachment")
- at4p2.Parent = LLeg
- at4p2.Visible = vis
- at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
- at4p2.Position = Vector3.new(0,1,0)
- local bis4 = Instance.new("BallSocketConstraint")
- bis4.Parent = LLeg
- bis4.Attachment0 = at4
- bis4.Attachment1 = at4p2
- bis4.LimitsEnabled = true
- bis4.UpperAngle = 180-15
- bis4.Visible = vis2
- table.insert(js,1,bis4)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local at5 = Instance.new("Attachment")
- at5.Parent = torso
- at5.Visible = vis
- at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
- at5.Position = Vector3.new(0,1,0)
- local at5p2 = Instance.new("Attachment")
- at5p2.Parent = head
- at5p2.Visible = vis
- at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
- at5p2.Position = Vector3.new(0,-.5,0)
- local bis5 = Instance.new("BallSocketConstraint")
- bis5.Parent = head
- bis5.Attachment0 = at5p2
- bis5.Attachment1 = at5
- bis5.LimitsEnabled = true
- bis5.UpperAngle = 75
- bis5.Visible = vis2
- bis5.TwistLimitsEnabled = true
- bis5.UpperAngle = -45
- bis5.TwistLowerAngle = -45
- table.insert(js,1,bis5)
- else
- --head:BreakJoints()
- end
- end
- else
- hum.Died:Connect(function()
- if hum.RigType==Enum.HumanoidRigType.R6 then
- for _,v in pairs(torso:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LArm and not LArm:FindFirstChild('Dismembered') then
- local at1 = Instance.new("Attachment")
- at1.Parent = torso
- at1.Visible = vis
- at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
- at1.Position = Vector3.new(-1,1,0)
- local at1p2 = Instance.new("Attachment")
- at1p2.Parent = LArm
- at1p2.Visible = vis
- at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
- at1p2.Position = Vector3.new(.5,1,0)
- local bis = Instance.new("BallSocketConstraint")
- bis.Parent = LArm
- bis.Attachment0 = at1
- bis.Attachment1 = at1p2
- bis.LimitsEnabled = true
- bis.UpperAngle = 15
- bis.Visible = vis2
- bis.TwistLimitsEnabled = true
- bis.UpperAngle = -45
- bis.TwistLowerAngle = -45
- table.insert(js,1,bis)
- end
- if RArm and not RArm:FindFirstChild('Dismembered') then
- local at2 = Instance.new("Attachment")
- at2.Parent = torso
- at2.Visible = vis
- at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
- at2.Position = Vector3.new(1,1,0)
- local at2p2 = Instance.new("Attachment")
- at2p2.Parent = RArm
- at2p2.Visible = vis
- at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
- at2p2.Position = Vector3.new(-.5,1,0)
- local bis2 = Instance.new("BallSocketConstraint")
- bis2.Parent = RArm
- bis2.Attachment0 = at2
- bis2.Attachment1 = at2p2
- bis2.LimitsEnabled = true
- bis2.UpperAngle = 15
- bis2.Visible = vis2
- bis2.TwistLimitsEnabled = true
- bis2.UpperAngle = -45
- bis2.TwistLowerAngle = -45
- table.insert(js,1,bis2)
- end
- if RLeg and not RLeg:FindFirstChild('Dismembered') then
- local at3 = Instance.new("Attachment")
- at3.Parent = torso
- at3.Visible = vis
- at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at3.Position = Vector3.new(.5,-1,0)
- local at3p2 = Instance.new("Attachment")
- at3p2.Parent = RLeg
- at3p2.Visible = vis
- at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
- at3p2.Position = Vector3.new(0,1,0)
- local bis3 = Instance.new("BallSocketConstraint")
- bis3.Parent = RLeg
- bis3.Attachment0 = at3
- bis3.Attachment1 = at3p2
- bis3.LimitsEnabled = true
- bis3.UpperAngle = 180-15
- bis3.Visible = vis2
- table.insert(js,1,bis3)
- end
- if LLeg and not LLeg:FindFirstChild('Dismembered') then
- local at4 = Instance.new("Attachment")
- at4.Parent = torso
- at4.Visible = vis
- at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at4.Position = Vector3.new(-.5,-1,0)
- local at4p2 = Instance.new("Attachment")
- at4p2.Parent = LLeg
- at4p2.Visible = vis
- at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
- at4p2.Position = Vector3.new(0,1,0)
- local bis4 = Instance.new("BallSocketConstraint")
- bis4.Parent = LLeg
- bis4.Attachment0 = at4
- bis4.Attachment1 = at4p2
- bis4.LimitsEnabled = true
- bis4.UpperAngle = 180-15
- bis4.Visible = vis2
- table.insert(js,1,bis4)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local at5 = Instance.new("Attachment")
- at5.Parent = torso
- at5.Visible = vis
- at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
- at5.Position = Vector3.new(0,1,0)
- local at5p2 = Instance.new("Attachment")
- at5p2.Parent = head
- at5p2.Visible = vis
- at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
- at5p2.Position = Vector3.new(0,-.5,0)
- local bis5 = Instance.new("BallSocketConstraint")
- bis5.Parent = head
- bis5.Attachment0 = at5p2
- bis5.Attachment1 = at5
- bis5.LimitsEnabled = true
- bis5.UpperAngle = 75
- bis5.Visible = vis2
- bis5.TwistLimitsEnabled = true
- bis5.UpperAngle = -45
- bis5.TwistLowerAngle = -45
- table.insert(js,1,bis5)
- else
- --head:BreakJoints()
- end
- end
- end)
- end
- elseif head and hum then
- hum.BreakJointsOnDeath = false
- if insta then
- if hum.RigType==Enum.HumanoidRigType.R15 then
- for _,v in pairs(pc:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LF and not LF:FindFirstChild('Dismembered') then
- local bsc1 = Instance.new("BallSocketConstraint",LF)
- bsc1.Attachment0 = LF.LeftAnkleRigAttachment
- bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
- table.insert(js,1,bsc1)
- end
- if LLL and not LLL:FindFirstChild('Dismembered') then
- local bsc2 = Instance.new("BallSocketConstraint",LLL)
- bsc2.Attachment0 = LLL.LeftKneeRigAttachment
- bsc2.Attachment1 = LUL.LeftKneeRigAttachment
- table.insert(js,1,bsc2)
- end
- if LUL and not LUL:FindFirstChild('Dismembered') then
- local bsc3 = Instance.new("BallSocketConstraint",LUL)
- bsc3.Attachment0 = LUL.LeftHipRigAttachment
- bsc3.Attachment1 = LT.LeftHipRigAttachment
- table.insert(js,1,bsc3)
- end
- if RF and not RF:FindFirstChild('Dismembered') then
- local bsc4 = Instance.new("BallSocketConstraint",RF)
- bsc4.Attachment0 = RF.RightAnkleRigAttachment
- bsc4.Attachment1 = RLL.RightAnkleRigAttachment
- table.insert(js,1,bsc4)
- end
- if RLL and not RLL:FindFirstChild('Dismembered') then
- local bsc5 = Instance.new("BallSocketConstraint",RLL)
- bsc5.Attachment0 = RLL.RightKneeRigAttachment
- bsc5.Attachment1 = RUL.RightKneeRigAttachment
- table.insert(js,1,bsc5)
- end
- if RUL and not RUL:FindFirstChild('Dismembered') then
- local bsc6 = Instance.new("BallSocketConstraint",RUL)
- bsc6.Attachment0 = RUL.RightHipRigAttachment
- bsc6.Attachment1 = LT.RightHipRigAttachment
- table.insert(js,1,bsc6)
- end
- if LH and not LH:FindFirstChild('Dismembered') then
- local bsc7 = Instance.new("BallSocketConstraint",LH)
- bsc7.Attachment0 = LH.LeftWristRigAttachment
- bsc7.Attachment1 = LLA.LeftWristRigAttachment
- table.insert(js,1,bsc7)
- end
- if LLA and not LLA:FindFirstChild('Dismembered') then
- local bsc8 = Instance.new("BallSocketConstraint",LLA)
- bsc8.Attachment0 = LLA.LeftElbowRigAttachment
- bsc8.Attachment1 = LUA.LeftElbowRigAttachment
- table.insert(js,1,bsc8)
- end
- if LUA and not LUA:FindFirstChild('Dismembered') then
- local bsc9 = Instance.new("BallSocketConstraint",LUA)
- bsc9.Attachment0 = LUA.LeftShoulderAttachment
- bsc9.Attachment1 = UT.LeftCollarAttachment
- table.insert(js,1,bsc9)
- end
- if RH and not RH:FindFirstChild('Dismembered') then
- local bsc10 = Instance.new("BallSocketConstraint",RH)
- bsc10.Attachment0 = RH.RightWristRigAttachment
- bsc10.Attachment1 = RLA.RightWristRigAttachment
- table.insert(js,1,bsc10)
- end
- if RLA and not RLA:FindFirstChild('Dismembered') then
- local bsc11 = Instance.new("BallSocketConstraint",RLA)
- bsc11.Attachment0 = RLA.RightElbowRigAttachment
- bsc11.Attachment1 = RUA.RightElbowRigAttachment
- table.insert(js,1,bsc11)
- end
- if RUA and not RUA:FindFirstChild('Dismembered') then
- local bsc12 = Instance.new("BallSocketConstraint",RUA)
- bsc12.Attachment0 = RUA.RightShoulderAttachment
- bsc12.Attachment1 = UT.RightCollarAttachment
- table.insert(js,1,bsc12)
- end
- if LT and not LT:FindFirstChild('Dismembered') then
- local bsc13 = Instance.new("BallSocketConstraint",LT)
- bsc13.Attachment0 = LT.WaistRigAttachment
- bsc13.Attachment1 = UT.WaistRigAttachment
- table.insert(js,1,bsc13)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local bsc14 = Instance.new("BallSocketConstraint",head)
- bsc14.Attachment0 = UT.NeckRigAttachment
- bsc14.Attachment1 = head.NeckRigAttachment
- bsc14.LimitsEnabled = true
- bsc14.UpperAngle = -75
- bsc14.TwistLimitsEnabled = true
- bsc14.UpperAngle = -45
- bsc14.TwistLowerAngle = -45
- table.insert(js,1,bsc14)
- else
- --head:BreakJoints()
- end
- end
- else
- hum.Died:Connect(function()
- if hum.RigType==Enum.HumanoidRigType.R15 then
- for _,v in pairs(pc:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LF and not LF:FindFirstChild('Dismembered') then
- local bsc1 = Instance.new("BallSocketConstraint",LF)
- bsc1.Attachment0 = LF.LeftAnkleRigAttachment
- bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
- table.insert(js,1,bsc1)
- end
- if LLL and not LLL:FindFirstChild('Dismembered') then
- local bsc2 = Instance.new("BallSocketConstraint",LLL)
- bsc2.Attachment0 = LLL.LeftKneeRigAttachment
- bsc2.Attachment1 = LUL.LeftKneeRigAttachment
- table.insert(js,1,bsc2)
- end
- if LUL and not LUL:FindFirstChild('Dismembered') then
- local bsc3 = Instance.new("BallSocketConstraint",LUL)
- bsc3.Attachment0 = LUL.LeftHipRigAttachment
- bsc3.Attachment1 = LT.LeftHipRigAttachment
- table.insert(js,1,bsc3)
- end
- if RF and not RF:FindFirstChild('Dismembered') then
- local bsc4 = Instance.new("BallSocketConstraint",RF)
- bsc4.Attachment0 = RF.RightAnkleRigAttachment
- bsc4.Attachment1 = RLL.RightAnkleRigAttachment
- table.insert(js,1,bsc4)
- end
- if RLL and not RLL:FindFirstChild('Dismembered') then
- local bsc5 = Instance.new("BallSocketConstraint",RLL)
- bsc5.Attachment0 = RLL.RightKneeRigAttachment
- bsc5.Attachment1 = RUL.RightKneeRigAttachment
- table.insert(js,1,bsc5)
- end
- if RUL and not RUL:FindFirstChild('Dismembered') then
- local bsc6 = Instance.new("BallSocketConstraint",RUL)
- bsc6.Attachment0 = RUL.RightHipRigAttachment
- bsc6.Attachment1 = LT.RightHipRigAttachment
- table.insert(js,1,bsc6)
- end
- if LH and not LH:FindFirstChild('Dismembered') then
- local bsc7 = Instance.new("BallSocketConstraint",LH)
- bsc7.Attachment0 = LH.LeftWristRigAttachment
- bsc7.Attachment1 = LLA.LeftWristRigAttachment
- table.insert(js,1,bsc7)
- end
- if LLA and not LLA:FindFirstChild('Dismembered') then
- local bsc8 = Instance.new("BallSocketConstraint",LLA)
- bsc8.Attachment0 = LLA.LeftElbowRigAttachment
- bsc8.Attachment1 = LUA.LeftElbowRigAttachment
- table.insert(js,1,bsc8)
- end
- if LUA and not LUA:FindFirstChild('Dismembered') then
- local bsc9 = Instance.new("BallSocketConstraint",LUA)
- bsc9.Attachment0 = LUA.LeftShoulderAttachment
- bsc9.Attachment1 = UT.LeftCollarAttachment
- table.insert(js,1,bsc9)
- end
- if RH and not RH:FindFirstChild('Dismembered') then
- local bsc10 = Instance.new("BallSocketConstraint",RH)
- bsc10.Attachment0 = RH.RightWristRigAttachment
- bsc10.Attachment1 = RLA.RightWristRigAttachment
- table.insert(js,1,bsc10)
- end
- if RLA and not RLA:FindFirstChild('Dismembered') then
- local bsc11 = Instance.new("BallSocketConstraint",RLA)
- bsc11.Attachment0 = RLA.RightElbowRigAttachment
- bsc11.Attachment1 = RUA.RightElbowRigAttachment
- table.insert(js,1,bsc11)
- end
- if RUA and not RUA:FindFirstChild('Dismembered') then
- local bsc12 = Instance.new("BallSocketConstraint",RUA)
- bsc12.Attachment0 = RUA.RightShoulderAttachment
- bsc12.Attachment1 = UT.RightCollarAttachment
- table.insert(js,1,bsc12)
- end
- if LT and not LT:FindFirstChild('Dismembered') then
- local bsc13 = Instance.new("BallSocketConstraint",LT)
- bsc13.Attachment0 = LT.WaistRigAttachment
- bsc13.Attachment1 = UT.WaistRigAttachment
- table.insert(js,1,bsc13)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local bsc14 = Instance.new("BallSocketConstraint",head)
- bsc14.Attachment0 = UT.NeckRigAttachment
- bsc14.Attachment1 = head.NeckRigAttachment
- bsc14.LimitsEnabled = true
- bsc14.UpperAngle = -75
- bsc14.TwistLimitsEnabled = true
- bsc14.UpperAngle = -45
- bsc14.TwistLowerAngle = -45
- table.insert(js,1,bsc14)
- else
- --head:BreakJoints()
- end
- end
- end)
- end
- end
- end
- return js,js2
- end
- local t = Instance.new("Tool")
- t.CanBeDropped = false
- local Part1 = Instance.new("Part")
- local Sound6 = Instance.new("Sound")
- t.Name = "Impostor Tool"
- t.TextureId = "rbxassetid://5701818647"
- t.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
- t.GripForward = Vector3.new(-1, -0, -0)
- t.GripPos = Vector3.new(0, 0, -1.5)
- t.GripRight = Vector3.new(0, 1, 0)
- t.GripUp = Vector3.new(0, 0, 1)
- Part1.Name = "Handle"
- Part1.Parent = t
- Part1.CFrame = CFrame.new(214.957138, 4.28734684, -190.317474, 0.0910440385, -0.881099463, 0.464084357, 0.537011683, 0.435894847, 0.722229123, -0.838648558, 0.183463722, 0.512845576)
- Part1.Orientation = Vector3.new(-46.2400017, 42.1399994, 50.9300003)
- Part1.Position = Vector3.new(214.957138, 4.28734684, -190.317474)
- Part1.Rotation = Vector3.new(-54.6199989, 27.6499996, 84.0999985)
- Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part1.Size = Vector3.new()
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Dark stone grey")
- Part1.Locked = true
- Part1.Transparency = 1
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Dark stone grey")
- Part1.FormFactor = Enum.FormFactor.Plate
- Part1.formFactor = Enum.FormFactor.Plate
- Sound6.Name = "Kill"
- Sound6.Parent = nil
- Sound6.SoundId = "rbxassetid://5677788502"
- Sound6.Volume = 2
- plr = owner
- local Tool = t
- local Handle = Tool:WaitForChild("Handle")
- Tool.Parent = plr['Backpack']
- local tag = Instance.new("ObjectValue")
- tag.Name = 'par'
- tag.Value = plr['Backpack']
- tag.Parent = t
- local char = plr.Character
- local hum = char:FindFirstChildOfClass("Humanoid")
- local root = char:FindFirstChild("HumanoidRootPart")
- local Players = game:GetService("Players")
- local Debris = game:GetService("Debris")
- local Sounds = {
- Kill = Sound6,
- }
- local function CheckIfAlive()
- return (((plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and root and root.Parent) and true) or false)
- end
- local can_kill = true
- local kill_cooldown = 10
- local kill_distance = 10
- local function kill(Hit,dist)
- if not Hit or not Hit.Parent or not CheckIfAlive() then
- return
- end
- local character = Hit.Parent
- if character == char then
- return
- end
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if not humanoid or humanoid.Health == 0 then
- return
- end
- local player = Players:GetPlayerFromCharacter(character)
- if player and ((player == plr)) then
- return
- end
- if can_kill then
- local sp = Instance.new("Part")
- sp.Size = Vector3.new()
- sp.Transparency = 1
- sp.CanCollide = false
- sp.Anchored = true
- sp.Locked = true
- sp.Position = root.Position
- sp.Parent = script
- local s1 = Sounds.Kill:Clone()
- s1.Parent = sp
- s1:Play()
- spawn(function()
- root.Anchored = true
- local sv = root.Velocity
- local trans = {}
- for i,v in pairs(char:GetDescendants()) do
- if (v:IsA("BasePart") or v:IsA("UnionOperation")) and 0 >= v.Transparency then
- trans[v] = true
- game:GetService("TweenService"):Create(v,TweenInfo.new(0.1),{Transparency = 1}):Play()
- end
- end
- game:GetService("TweenService"):Create(root,TweenInfo.new(0.1),{CFrame = Hit.CFrame}):Play()
- humanoid:TakeDamage(1/0)
- wait(0.1)
- for i,v in pairs(trans) do
- game:GetService("TweenService"):Create(i,TweenInfo.new(0.1),{Transparency = 0}):Play()
- end
- root.Anchored = false
- root.Velocity = sv
- local tempkillval = Instance.new("ObjectValue")
- tempkillval.Name = 'killer'
- tempkillval.Value = nil -- plr
- tempkillval.Parent = humanoid
- humanoid:TakeDamage(1/0)
- local ragval = Instance.new("ObjectValue")
- ragval.Name = 'Ragdolled'
- ragval.Parent = humanoid
- humanoid.AutoRotate = false
- humanoid.PlatformStand = true
- Ragdoll(character,true,true,true)
- end)
- spawn(function()
- can_kill = false
- Tool.Parent = nil
- wait(kill_cooldown)
- if not char or not hum or not root or 0 >= hum.Health then
- repeat
- wait(1)
- char = plr.Character
- hum = char:FindFirstChildOfClass("Humanoid")
- root = char:FindFirstChild("HumanoidRootPart")
- until char and hum and root and hum.Health > 0
- end
- Tool.Parent = plr['Backpack']
- can_kill = true
- end)
- end
- end
- local function get_near()
- local dist = kill_distance
- local near = nil
- for i,v in pairs(workspace:GetChildren()) do
- if v ~= char then else continue end
- local tc = v
- local tt = nil
- local th = nil
- pcall(function()
- tt = tc:FindFirstChild("HumanoidRootPart") or tc:FindFirstChild("Torso") or tc:FindFirstChild("Head")
- end)
- pcall(function()
- th = tc:FindFirstChildOfClass("Humanoid")
- end)
- if tc and tt and th and th.Health > 0 then
- local cdi = (tt.Position-root.Position).Magnitude
- if dist >= cdi then
- dist = cdi
- near = tt
- end
- end
- end
- return near,dist
- end
- Tool.Equipped:Connect(function()
- local near,dist = get_near()
- if not near then
- wait(0)
- if not can_kill then
- Tool.Parent = nil
- else
- if not char or not hum or not root or 0 >= hum.Health then
- repeat
- wait(1)
- char = plr.Character
- hum = char:FindFirstChildOfClass("Humanoid")
- root = char:FindFirstChild("HumanoidRootPart")
- until char and hum and root and hum.Health > 0
- end
- Tool.Parent = plr['Backpack']
- end
- else
- kill(near)
- end
- end)
- local d = game.Players.lafur2.Character:GetChildren()
- for i=1, #d do
- if (d[i].className == "Hat") then
- d[i]:remove()
- end
- end
- for i=1, #d do
- if (d[i].className == "Accessory") then
- d[i]:remove()
- end
- end
- local LA = Instance.new("SpecialMesh")
- local RA = Instance.new("SpecialMesh")
- local LL = Instance.new("SpecialMesh")
- local RL = Instance.new("SpecialMesh")
- local H = Instance.new("SpecialMesh")
- local T = Instance.new("SpecialMesh")
- local pl = game.Players.lafur2.Character
- local la = pl:WaitForChild("Left Arm")
- local ra = pl:WaitForChild("Right Arm")
- local ll = pl:WaitForChild("Left Leg")
- local rl = pl:WaitForChild("Right Leg")
- local h = pl:WaitForChild("Head")
- local t = pl:WaitForChild("Torso")
- LA.Parent = la
- RA.Parent = ra
- LL.Parent = ll
- RL.Parent = rl
- H.Parent = h
- T.Parent = t
- LA.Scale = Vector3.new(0,0,0)
- RA.Scale = Vector3.new(0,0,0)
- LA.Offset = Vector3.new(-1,0,0)
- RA.Offset = Vector3.new(1,0,0)
- LA.MeshType = Enum.MeshType.Sphere
- RA.MeshType = Enum.MeshType.Sphere
- RL.MeshType = Enum.MeshType.Head
- LL.MeshType = Enum.MeshType.Head
- T.Scale = Vector3.new(1.5,2,2.5)
- T.MeshType = Enum.MeshType.Sphere
- H.Scale = Vector3.new(1,1.25,1.5)
- H.Offset = Vector3.new(0,-0.75,-0.75)
- H.MeshType = Enum.MeshType.Sphere
- local COLOR = BrickColor.Random()
- la.BrickColor = COLOR
- ra.BrickColor = COLOR
- ll.BrickColor = COLOR
- rl.BrickColor = COLOR
- h.BrickColor = BrickColor.new("Toothpaste")
- h.Reflectance = 0.5
- t.BrickColor = COLOR
- h.face:Destroy()
- la.TopSurface = Enum.SurfaceType.Smooth
- la.BottomSurface = Enum.SurfaceType.Smooth
- la.LeftSurface = Enum.SurfaceType.Smooth
- la.RightSurface = Enum.SurfaceType.Smooth
- la.FrontSurface = Enum.SurfaceType.Smooth
- la.BackSurface = Enum.SurfaceType.Smooth
- ra.TopSurface = Enum.SurfaceType.Smooth
- ra.BottomSurface = Enum.SurfaceType.Smooth
- ra.LeftSurface = Enum.SurfaceType.Smooth
- ra.RightSurface = Enum.SurfaceType.Smooth
- ra.FrontSurface = Enum.SurfaceType.Smooth
- ra.BackSurface = Enum.SurfaceType.Smooth
- ll.TopSurface = Enum.SurfaceType.Smooth
- ll.BottomSurface = Enum.SurfaceType.Smooth
- ll.LeftSurface = Enum.SurfaceType.Smooth
- ll.RightSurface = Enum.SurfaceType.Smooth
- ll.FrontSurface = Enum.SurfaceType.Smooth
- ll.BackSurface = Enum.SurfaceType.Smooth
- rl.TopSurface = Enum.SurfaceType.Smooth
- rl.BottomSurface = Enum.SurfaceType.Smooth
- rl.LeftSurface = Enum.SurfaceType.Smooth
- rl.RightSurface = Enum.SurfaceType.Smooth
- rl.FrontSurface = Enum.SurfaceType.Smooth
- rl.BackSurface = Enum.SurfaceType.Smooth
- t.TopSurface = Enum.SurfaceType.Smooth
- t.BottomSurface = Enum.SurfaceType.Smooth
- t.LeftSurface = Enum.SurfaceType.Smooth
- t.RightSurface = Enum.SurfaceType.Smooth
- t.FrontSurface = Enum.SurfaceType.Smooth
- t.BackSurface = Enum.SurfaceType.Smooth
- h.TopSurface = Enum.SurfaceType.Smooth
- h.BottomSurface = Enum.SurfaceType.Smooth
- h.LeftSurface = Enum.SurfaceType.Smooth
- h.RightSurface = Enum.SurfaceType.Smooth
- h.FrontSurface = Enum.SurfaceType.Smooth
- h.BackSurface = Enum.SurfaceType.Smooth
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement