Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Character=owner.Character
- local leftarm = Character:FindFirstChild("Left Arm")
- local leftleg = Character:FindFirstChild("Left Leg")
- local rightleg = Character:FindFirstChild("Right Leg")
- local rightarm = Character:FindFirstChild("Right Arm")
- local torso = Character:FindFirstChild("Torso")
- local head = Character:FindFirstChild("Head")
- local root = Character:FindFirstChild("HumanoidRootPart")
- local HeadA = Instance.new("Attachment")
- HeadA.Name = "HeadA"
- HeadA.Parent = head
- HeadA.Position = Vector3.new(0, -0.5, 0)
- HeadA.Rotation = Vector3.new(0, 0, -0)
- HeadA.Axis = Vector3.new(1, -0, -0)
- HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
- local LeftArmA = Instance.new("Attachment")
- LeftArmA.Name = "LeftArmA"
- LeftArmA.Parent = leftarm
- LeftArmA.Position = Vector3.new(0.4, 0.8, 0)
- LeftArmA.Rotation = Vector3.new(-180, 0, 90)
- LeftArmA.Axis = Vector3.new(0, -1, -0)
- LeftArmA.SecondaryAxis = Vector3.new(-1, 0, 0)
- local LeftLegA = Instance.new("Attachment")
- LeftLegA.Name = "LeftLegA"
- LeftLegA.Parent = leftleg
- LeftLegA.Position = Vector3.new(0, 1, 0)
- LeftLegA.Rotation = Vector3.new(90, -90, 0)
- LeftLegA.Axis = Vector3.new(0, -1, -0)
- LeftLegA.SecondaryAxis = Vector3.new(0, -0, 1)
- local RightArmA = Instance.new("Attachment")
- RightArmA.Name = "RightArmA"
- RightArmA.Parent = rightarm
- RightArmA.Position = Vector3.new(-0.4, 0.8, 0)--Vector3.new(0, 1, 0)
- RightArmA.Rotation = Vector3.new(-180, 0, 90)--Vector3.new(90, -90, 0)
- RightArmA.Axis = Vector3.new(0, -1, -0)--Vector3.new(0, -1, -0)
- RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)--Vector3.new(0, -0, 1)
- local RightLegA = Instance.new("Attachment")
- RightLegA.Name = "RightLegA"
- RightLegA.Parent = rightleg
- RightLegA.Position = Vector3.new(0, 1, 0) --Vector3.new(-0.4, 0.8, 0)
- RightLegA.Rotation = Vector3.new(90, -90, 0)--Vector3.new(-180, 0, 90)
- RightLegA.Axis = Vector3.new(0, -1, -0)--Vector3.new(0, -1, -0)
- RightLegA.SecondaryAxis = Vector3.new(0, -0, 1)--Vector3.new(0, 1, 0)
- local TorsoA = Instance.new("Attachment")
- TorsoA.Name = "TorsoA"
- TorsoA.Parent = torso
- TorsoA.Position = Vector3.new(0.5, -1.1, 0)
- TorsoA.Rotation = Vector3.new(90, -90, 0)
- TorsoA.Axis = Vector3.new(0, -1, -0)
- TorsoA.SecondaryAxis = Vector3.new(0, -0, 1)
- local TorsoA1 = Instance.new("Attachment")
- TorsoA1.Name = "TorsoA1"
- TorsoA1.Parent = torso
- TorsoA1.Position = Vector3.new(-0.5, -1.1, 0)
- TorsoA1.Rotation = Vector3.new(90, -90, 0)
- TorsoA1.Axis = Vector3.new(0, -1, -0)
- TorsoA1.SecondaryAxis = Vector3.new(0, -0, 1)
- local TorsoA2 = Instance.new("Attachment")
- TorsoA2.Name = "TorsoA2"
- TorsoA2.Parent = torso
- TorsoA2.Position = Vector3.new(-1, 0.8, 0)
- TorsoA2.Rotation = Vector3.new(0, 0, -180)
- TorsoA2.Axis = Vector3.new(-1, -0, 0)
- TorsoA2.SecondaryAxis = Vector3.new(0, -1, 0)
- local TorsoA3 = Instance.new("Attachment")
- TorsoA3.Name = "TorsoA3"
- TorsoA3.Parent = torso
- TorsoA3.Position = Vector3.new(1, 0.8, 0)
- TorsoA3.Rotation = Vector3.new(-180, 0, 0)
- TorsoA3.Axis = Vector3.new(1, -0, 0)
- TorsoA3.SecondaryAxis = Vector3.new(-0, -1, -0)
- local TorsoA4 = Instance.new("Attachment")
- TorsoA4.Name = "TorsoA4"
- TorsoA4.Parent = torso
- TorsoA4.Position = Vector3.new(0, 1, 0)
- TorsoA4.Rotation = Vector3.new(0, 0, -0)
- TorsoA4.Axis = Vector3.new(1, -0, 0)
- TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
- local TorsoA5 = Instance.new("Attachment")
- TorsoA5.Name = "TorsoA5"
- TorsoA5.Parent = torso
- TorsoA5.Position = Vector3.new(0, 0, 0)
- TorsoA5.Rotation = Vector3.new(0, 90, 0)
- TorsoA5.Axis = Vector3.new(0, 0, -1)
- TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
- local TorsoA6 = Instance.new("Attachment")
- TorsoA6.Name = "TorsoA6"
- TorsoA6.Parent = torso
- TorsoA6.Position = Vector3.new(0, 1, 0)
- TorsoA5.Rotation = Vector3.new(0, 0, 0)
- --TorsoA6.Axis = Vector3.new(0, 0, -1)
- --TorsoA6.SecondaryAxis = Vector3.new(0, 1, 0)
- local rootA = Instance.new("Attachment")
- rootA.Name= "rootA"
- rootA.Parent = root
- rootA.Position = Vector3.new(0, 0, 0)
- rootA.Rotation = Vector3.new(0, 90, 0)
- rootA.Axis = Vector3.new(0, 0, -1)
- rootA.SecondaryAxis = Vector3.new(0, 1, 0)
- local LAT = Instance.new("BallSocketConstraint")
- LAT.Parent = leftarm
- LAT.Attachment0 = LeftArmA
- LAT.Attachment1 = TorsoA2
- LAT.Enabled = true
- local RAT = Instance.new("BallSocketConstraint")
- RAT.Parent = rightarm
- RAT.Attachment0 = RightArmA
- RAT.Attachment1 = TorsoA3
- RAT.Enabled = true
- local TLL = Instance.new("BallSocketConstraint")
- TLL.Parent = torso
- TLL.Attachment0 = TorsoA1
- TLL.Attachment1 = LeftLegA
- TLL.Enabled = true
- local TRL = Instance.new("BallSocketConstraint")
- TRL.Parent = torso
- TRL.Attachment0 = TorsoA
- TRL.Attachment1 = RightLegA
- TRL.Enabled = true
- local RTA = Instance.new("BallSocketConstraint")
- RTA.Parent = root
- RTA.Attachment0 = rootA
- RTA.Attachment1 = TorsoA5
- RTA.Enabled = true
- local Neck = Instance.new("BallSocketConstraint")
- Neck.Parent = torso
- Neck.Attachment0 = TorsoA6
- Neck.Attachment1 = HeadA
- Neck.Enabled = true
- function getAttachment0(attachmentName)
- for _,child in next,Character:GetChildren() do
- local attachment = child:FindFirstChild(attachmentName)
- if attachment then
- return attachment
- end
- end
- end
- for _,child in next,Character:GetChildren() do
- if child:IsA("Accoutrement") then
- --Loop through all parts instead of only checking for one to be forwards-compatible in the event
- --ROBLOX implements multi-part accessories
- for _,part in next,child:GetChildren() do
- if part:IsA("BasePart") then
- local attachment1 = part:FindFirstChildOfClass("Attachment")
- local attachment0 = getAttachment0(attachment1.Name)
- if attachment0 and attachment1 then
- --Shouldn't use constraints for this, but have to because of a ROBLOX idiosyncrasy where
- --joints connecting a character are perpetually deleted while the character is dead
- local constraint = Instance.new("HingeConstraint")
- constraint.Attachment0 = attachment0
- constraint.Attachment1 = attachment1
- constraint.LimitsEnabled = true
- constraint.UpperAngle = 0 --Simulate weld by making it difficult for constraint to move
- constraint.LowerAngle = 0
- constraint.Parent = Character
- end
- end
- end
- end
- end
- owner.Character.Humanoid.Died:connect(function()
- local ex = Instance.new("Explosion", workspace)
- ex.Position = owner.Character.Torso.Position
- local sound = Instance.new("Sound", owner.Character.Torso)
- sound.SoundId = "rbxassetid://899623922"
- sound.Volume = 2
- sound:Play()
- end)
Add Comment
Please, Sign In to add comment