I'm trying to make a ragdoll system that whenever I click it turns me into a ragdoll. Only problem is that it's not. It might be that I'm doing it R6 but I'm not very sure. If you could help me that would be very appreciated.

Server Script

game.ReplicatedStorage.StaminaRem.ARemote.OnServerEvent:Connect(function(Player)
	local char = Player.Character or Player.CharacterAdded:Wait()
	local d = char:GetDescendants()
	for i=1,#d do
		local desc = d[i]
		if desc:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local part0 = desc.Part0
			local joint_name = desc.Name
			local attachment0 = desc.Parent:FindFirstChild(joint_name.."Attachment") or desc.Parent:FindFirstChild(joint_name.."RigAttachment")
			local attachment1 = part0:FindFirstChild(joint_name.."Attachment") or part0:FindFirstChild(joint_name.."RigAttachment")
			if attachment0 and attachment1 then
				socket.Attachment0, socket.Attachment1 = attachment0, attachment1
				socket.Parent = desc.Parent
				desc:Destroy()
			end	
		end
	end
end)

Don't worry about whats in the local script,

Regards, Bl_ueHistory

3 comments

0

Any errors?

1

Also, if you could send me the local script, i can help more.

0

The local script is really just a FireServer() only used to grab the player. Thats why i said not to worry about it