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:

local char = script.Parent
local hum = char.Humanoid

hum.BreakJointsOnDeath = false

game.Players.PlayerAdded:Connect(function()
	for i, j in pairs(char:GetDescendants()) do
		if j:IsA('Motor6D') then
			local socket = Instance.new('BallSocketConstraint', j.Parent)
			local a0 = Instance.new('Attachment', j.Part0)
			local a1 = Instance.new('Attachment', j.Part1)
			
			socket.Attachment0 = a0
			socket.Attachment1 = a1
			a0.CFrame = j.C0
			a1.CFrame = j.C1
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			j:Destroy()
		end
	end
end)

2 comments

0

wdym by "FYI"?