Whenever I load my character I don't ragdoll, why?
Asked by
4 years ago Edited 4 years ago
I'm trying to make it so that the player can move while they are ragdolled, but the player doesn't even ragdoll at all. I got the ragdoll code from this video: https://www.youtube.com/watch?v=OxtXeV49V60. Did I place a line of code in the wrong place or what? Thanks to who solves this.
Code:
01 | local char = script.Parent |
02 | local hum = char.Humanoid |
04 | hum.BreakJointsOnDeath = false |
06 | game.Players.PlayerAdded:Connect( function () |
07 | for i, j in pairs (char:GetDescendants()) do |
08 | if j:IsA( 'Motor6D' ) then |
09 | local socket = Instance.new( 'BallSocketConstraint' , j.Parent) |
10 | local a 0 = Instance.new( 'Attachment' , j.Part 0 ) |
11 | local a 1 = Instance.new( 'Attachment' , j.Part 1 ) |
13 | socket.Attachment 0 = a 0 |
14 | socket.Attachment 1 = a 1 |
17 | socket.LimitsEnabled = true |
18 | socket.TwistLimitsEnabled = true |