Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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:

01local char = script.Parent
02local hum = char.Humanoid
03 
04hum.BreakJointsOnDeath = false
05 
06game.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 a0 = Instance.new('Attachment', j.Part0)
11            local a1 = Instance.new('Attachment', j.Part1)
12 
13            socket.Attachment0 = a0
14            socket.Attachment1 = a1
15            a0.CFrame = j.C0
View all 22 lines...

Answer this question