Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ChuckXZ
- local xz_Inst = Instance.new
- local xz_CF = CFrame.new
- local Util = require(script.Parent.UtilityFunctions)
- local ConstraintList = {
- --[[{
- Name = "HumanoidRootPart",
- Connector = "UpperTorso",
- V1 = Vector3.new(0,0,1),
- V2 = Vector3.new(0,0,-1)
- },]]
- {
- Name = "Head",
- Connector = "UpperTorso",
- V1 = Vector3.new(0,-.5,0),
- V2 = Vector3.new(0,1,0)
- },
- {
- Name = "UpperTorso",
- Connector = "LowerTorso",
- V1 = Vector3.new(0,-.75,0),
- V2 = Vector3.new(0,.25,0)
- },
- {
- Name = "LeftUpperArm",
- Connector = "UpperTorso",
- V1 = Vector3.new(.5,0,0),
- V2 = Vector3.new(-1,.5,0),
- HB = true
- },
- {
- Name = "LeftLowerArm",
- Connector = "LeftUpperArm",
- V1 = Vector3.new(0,0,0),
- V2 = Vector3.new(0,-.5,0)
- },
- {
- Name = "LeftHand",
- Connector = "LeftLowerArm",
- V1 = Vector3.new(0,-.5,0),
- V2 = Vector3.new(0,.1,0),
- HB = true
- },
- {
- Name = "RightUpperArm",
- Connector = "UpperTorso",
- V1 = Vector3.new(.5,0,0),
- V2 = Vector3.new(1,.5,0),
- HB = true
- },
- {
- Name = "RightLowerArm",
- Connector = "RightUpperArm",
- V1 = Vector3.new(0,0,0),
- V2 = Vector3.new(0,-.5,0)
- },
- {
- Name = "RightHand",
- Connector = "RightLowerArm",
- V1 = Vector3.new(0,-.5,0),
- V2 = Vector3.new(0,.1,0),
- HB = true
- },
- {
- Name = "LeftUpperLeg",
- Connector = "LowerTorso",
- V1 = Vector3.new(0,.5,0),
- V2 = Vector3.new(-.8,-.1,0),
- HB = true
- },
- {
- Name = "LeftLowerLeg",
- Connector = "LeftUpperLeg",
- V1 = Vector3.new(0,0,0),
- V2 = Vector3.new(0,-.5,0)
- },
- {
- Name = "LeftFoot",
- Connector = "LeftLowerLeg",
- V1 = Vector3.new(0,-.5,0),
- V2 = Vector3.new(0,.1,0),
- HB = true
- },
- {
- Name = "RightUpperLeg",
- Connector = "LowerTorso",
- V1 = Vector3.new(0,.5,0),
- V2 = Vector3.new(.8,-.1,0),
- HB = true
- },
- {
- Name = "RightLowerLeg",
- Connector = "RightUpperLeg",
- V1 = Vector3.new(0,0,0),
- V2 = Vector3.new(0,-.5,0)
- },
- {
- Name = "RightFoot",
- Connector = "RightLowerLeg",
- V1 = Vector3.new(0,-.5,0),
- V2 = Vector3.new(0,.1,0),
- HB = true
- },
- }
- local MotorList = {
- {
- Name = "Neck",
- P1 = "UpperTorso",
- P2 = "Head",
- C0 = CFrame.new(-5.96046448e-08, 0.800017118, 1.1920929e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-0, -0.500000119, -0.000272244215, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "Head"
- },
- {
- Name = "Waist",
- P1 = "LowerTorso",
- P2 = "UpperTorso",
- C0 = CFrame.new(-1.1920929e-07, 0.200024918, 7.64462551e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-5.96046448e-08, -0.799985707, 1.1920929e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "UpperTorso"
- },
- {
- Name = "Root",
- P1 = "HumanoidRootPart",
- P2 = "LowerTorso",
- C0 = CFrame.new(0, -0.349999994, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-1.1920929e-07, -0.199972257, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LowerTorso"
- },
- {
- Name = "LeftHip",
- P1 = "LowerTorso",
- P2 = "LeftUpperLeg",
- C0 = CFrame.new(-0.500000119, -0.199972257, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(5.96046448e-08, 0.420782149, -1.63912773e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LeftUpperLeg"
- },
- {
- Name = "LeftKnee",
- P1 = "LeftUpperLeg",
- P2 = "LeftLowerLeg",
- C0 = CFrame.new(8.94069672e-08, -0.401102364, -4.29081496e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(2.98023224e-08, 0.379018426, -1.60860594e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LeftLowerLeg"
- },
- {
- Name = "LeftAnkle",
- P1 = "LeftLowerLeg",
- P2 = "LeftFoot",
- C0 = CFrame.new(-1.1920929e-07, -0.547157168, -2.21401592e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-1.78813934e-07, 0.101939678, -1.7222776e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LeftFoot"
- },
- {
- Name = "RightHip",
- P1 = "LowerTorso",
- P2 = "RightUpperLeg",
- C0 = CFrame.new(0.499999881, -0.199972257, -1.91208565e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-0, 0.420782268, -6.67300628e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "RightUpperLeg"
- },
- {
- Name = "RightKnee",
- P1 = "RightUpperLeg",
- P2 = "RightLowerLeg",
- C0 = CFrame.new(-0, -0.400946498, -2.18767891e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-0, 0.379174292, 2.5553607e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "RightLowerLeg"
- },
- {
- Name = "RightAnkle",
- P1 = "RightLowerLeg",
- P2 = "RightFoot",
- C0 = CFrame.new(-0, -0.547157168, 7.62689815e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-0, 0.101939559, 7.64477954e-05, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "RightFoot"
- },
- {
- Name = "LeftShoulder",
- P1 = "UpperTorso",
- P2 = "LeftUpperArm",
- C0 = CFrame.new(-1, 0.56301713, 1.1920929e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(0.500000358, 0.394326687, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LeftUpperArm"
- },
- {
- Name = "LeftElbow",
- P1 = "LeftUpperArm",
- P2 = "LeftLowerArm",
- C0 = CFrame.new(0.000479221344, -0.334056377, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(0.000478625298, 0.258688211, 7.64462551e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LeftLowerArm"
- },
- {
- Name = "LeftWrist",
- P1 = "LeftLowerArm",
- P2 = "LeftHand",
- C0 = CFrame.new(0.000478625298, -0.5009287, 7.64462551e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(0.000478982925, 0.125045404, 5.96046448e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "LeftHand"
- },
- {
- Name = "RightShoulder",
- P1 = "UpperTorso",
- P2 = "RightUpperArm",
- C0 = CFrame.new(0.99999994, 0.56301713, 1.1920929e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(-0.500000715, 0.394326687, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "RightUpperArm"
- },
- {
- Name = "RightElbow",
- P1 = "RightUpperArm",
- P2 = "RightLowerArm",
- C0 = CFrame.new(-5.96046448e-07, -0.334165096, 8.94069672e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(1.1920929e-07, 0.258579493, 7.64462551e-20, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "RightLowerArm"
- },
- {
- Name = "RightWrist",
- P1 = "RightLowerArm",
- P2 = "RightHand",
- C0 = CFrame.new(1.1920929e-07, -0.5009287, -6.86244753e-18, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- C1 = CFrame.new(3.57627869e-07, 0.125045404, 5.96046448e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1),
- Parent = "RightHand"
- },
- }
- local ConstList = {
- {
- Type = "HingeConstraint",
- Att1Off = Vector3.new()
- }
- }
- local function MakeAttachment(Part,Pos)
- local Att = xz_Inst("Attachment",Part)
- Att.CFrame = xz_CF(Pos)
- Att.Visible = true
- return Att
- end
- local function MakeConstraint(Att1, Att2)
- local Constrnt = xz_Inst("RodConstraint",Att1.Parent)
- Constrnt.Length = .25
- Constrnt.Attachment0 = Att1
- Constrnt.Attachment1 = Att2
- Constrnt.Visible = true
- end
- local function Weld(P0,P1,C0,C1,Id,Returned)
- local W = Instance.new("Weld")
- W.Name = Id
- W.Parent = P1
- W.Part0 = P0
- W.Part1 = P1
- W.C0 = C0
- W.C1 = C1
- if Returned then return W end
- end
- local function HitBox(Prt)
- local p = xz_Inst("Part")
- p.Name = "Hitbox_" .. Prt.Name
- p.Size = Prt.Size * .4
- p.Anchored = false
- p.CanCollide = true
- p.Transparency = 1
- p.Parent = Prt.Parent
- Weld(Prt,p,xz_CF(0,0,0),xz_CF(0,0,0),"HB",false)
- end
- local module = {}
- function module:MakeRagDoll(char)
- local model = xz_Inst("Model",game.Workspace.Debribs)
- local cf
- local t
- local Roog = xz_Inst("IntValue")
- Roog.Name = "ragdoll"
- Roog.Parent = char
- for i,v in pairs(game.ServerStorage.Dummy:GetDescendants()) do
- if v:IsA("HingeConstraint") or v:IsA("BallSocketConstraint") then
- spawn(function()
- local cl = v:Clone()
- local at0 = cl.Attachment0:Clone()
- local at1 = cl.Attachment1:Clone()
- local atpar = cl.Attachment1.Parent.Name
- local parName = v.Parent.Name
- local par1,par2 = char:FindFirstChild(atpar),char:FindFirstChild(parName)
- if par1 and par2 then
- cl.Parent = par2
- at0.Parent = par2
- at1.Parent = par1
- cl.Attachment0 = at0
- cl.Attachment1 = at1
- cl.Visible = false
- at0.Visible = false
- at1.Visible = false
- end
- end)
- elseif v.Name == "HBW" then
- local p1 = v.Part1.Name
- local parr = char:FindFirstChild(p1)
- if parr then
- local cl = v.Part0:Clone()
- local mot = xz_Inst("Motor6D")
- mot.Name = "HBW"
- mot.Parent = cl
- cl.Parent = char
- mot.Part0 = cl
- mot.Part1 = parr
- mot.C0 = v.C0
- mot.C1 = v.C1
- cl.Transparency = 1
- end
- end
- end
- for a,b in pairs(char:GetDescendants()) do
- if b:IsA("JointInstance") and b.Name ~= "HBW" and b.Parent.Name ~= "Gun" and b.Name ~= "Neck" and not string.find(b.Parent.Name,"Hitbox_") and not b.Parent.Parent:IsA("Accessory") and not b:IsA("Accessory") then
- b:Destroy()
- end
- end
- Weld(char.UpperTorso,char.HumanoidRootPart,CFrame.new(0,0,0),CFrame.new(0,0,0),"RootWeld",false)
- --model.PrimaryPart = t
- --model:SetPrimaryPartCFrame(cf)
- --Collides(model)
- end
- function module:FixRagdoll(char)
- local roge = char:FindFirstChild("ragdoll")
- if roge then
- roge:Destroy()
- else
- return
- end
- for a,b in pairs(char:GetDescendants()) do
- if b:IsA("BallSocketConstraint") or b:IsA("HingeConstraint") then
- b.Attachment0:Destroy()
- b.Attachment1:Destroy()
- b:Destroy()
- elseif b.Name == "HBW" then
- b.Part0:Destroy()
- end
- end
- for i,v in pairs(MotorList) do
- local P1 = char:FindFirstChild(MotorList[i]["P1"])
- local P2 = char:FindFirstChild(MotorList[i]["P2"])
- local Par = char:FindFirstChild(MotorList[i]["Parent"])
- if P1 and P2 and Par then
- local Mot = xz_Inst("Motor6D")
- Mot.Name = MotorList[i]["Name"]
- Mot.Parent = Par
- Mot.Part0 = P1
- Mot.Part1 = P2
- Mot.C0 = MotorList[i]["C0"]
- Mot.C1 = MotorList[i]["C1"]
- end
- end
- local upp = char:FindFirstChild("HumanoidRootPart")
- if upp then
- local weldd = upp:FindFirstChild("RootWeld")
- if weldd then
- weldd:Destroy()
- end
- upp.CFrame = CFrame.new(upp.Position) + Vector3.new(0,3,0)
- end
- local hum = char:FindFirstChild("Humanoid")
- if hum then
- hum:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics,true)
- end
- end
- return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement