Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- RAGDOLL with PRESSING KEY by BLOXIANCODE youtube.com/c/BloxianCode
- -- Tutorial: https://youtu.be/zycVpt-ClEQ
- local RagdollEvent = game.ReplicatedStorage.RagdollEvent
- RagdollEvent.OnServerEvent:Connect(function(player, input)
- if input == "go" then
- for i, v in pairs(player.Character:GetDescendants()) do
- if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
- local Socket = Instance.new("BallSocketConstraint")
- local a1 = Instance.new("Attachment")
- local a2 = Instance.new("Attachment")
- a1.Parent = v.Part0
- a2.Parent = v.Part1
- Socket.Parent = v.Parent
- Socket.Attachment0 = a1
- Socket.Attachment1 = a2
- a1.CFrame = v.C0
- a2.CFrame = v.C1
- Socket.LimitsEnabled = true
- Socket.TwistLimitsEnabled = true
- v:Destroy()
- end
- end
- player.Character.Humanoid.RequiresNeck = false
- player.Character.Humanoid.Sit = true
- else
- for i,v in pairs(player.Character:GetDescendants()) do
- if v:IsA("BallSocketConstraint") then
- v.UpperAngle = 0
- v.TwistUpperAngle = 0
- v.TwistLowerAngle = 0
- local Joints = Instance.new("Motor6D",v.Parent)
- Joints.Part0 = v.Attachment0.Parent
- Joints.Part1 = v.Attachment1.Parent
- Joints.C0 = v.Attachment0.CFrame
- Joints.C1 = v.Attachment1.CFrame
- v:Destroy()
- end
- end
- player.Character.Humanoid.Sit = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment