Help for ragdoll script

Hello! I’d like help for this script i made , the script is supposed to turn the Player into a Ragdoll whenever they die . However it does not work , i will send a picture of the script , it’d be preferable to dm me on discord to help me though , it would be easier , my discord is froggo #2611

1 Like

Hi, welcome to the community!

Can you send me the code as text?

Make sure to use the code tags:

image

Also, what are the errors you receive in output?


Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(character)
		character.Humanoid.BreakJointsOnDeath = false
		character.Humanoid.Died:Connect(function( )
			for _, v in pairs(character:GetDescendants()) do
				if v:IsA("Motor6D")	then
					character.HumanoidRootPart.CanCollide = false
					local Attachment0, Attachment1 =Instance.new("Attachment"), Istance.new("attachment")
					Attachment0.CFRAME = v.C0
					ball.attachment = ball.attachment -attachment 
					Attachment0.Parent = v.Part0
					ball.attachment = ball.attachment -attachment 
					local BallSocketConstraint = Instance.new("BallSocketConstraint")
					BallSocketConstraint.Attachment0 = Attachment0
					BallSocketConstraint.Attachment1 = Attachment1
					BallSocketConstraint.Parent = v.Parent
					
					v:Destroy()
			   end
			end)
		   Character.HumanoidRootPart.CanCollide = false
       end)
    end)
end)

here is the code
Capture d’écran 2022-07-19 213441
whenever i run the game it shows me this , i still don’t get it

On line #1 you haven’t imported players so you can simply do: game.players, next your end shouldn’t have a ) at the end, try this:

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(character)
		character.Humanoid.BreakJointsOnDeath = false
		character.Humanoid.Died:Connect(function( )
			for _, v in pairs(character:GetDescendants()) do
				if v:IsA("Motor6D")	then
					character.HumanoidRootPart.CanCollide = false
					local Attachment0, Attachment1 =Instance.new("Attachment"), Istance.new("attachment")
					Attachment0.CFRAME = v.C0
					ball.attachment = ball.attachment -attachment 
					Attachment0.Parent = v.Part0
					ball.attachment = ball.attachment -attachment 
					local BallSocketConstraint = Instance.new("BallSocketConstraint")
					BallSocketConstraint.Attachment0 = Attachment0
					BallSocketConstraint.Attachment1 = Attachment1
					BallSocketConstraint.Parent = v.Parent

					v:Destroy()
				end
			end
		Character.HumanoidRootPart.CanCollide = false
	end)
end)
end)
Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(character)
		character.Humanoid.BreakJointsOnDeath = false
		character.Humanoid.Died:Connect(function( )
			for _, v in pairs(character:GetDescendants()) do
				if v:IsA("Motor6D")	then
					character.HumanoidRootPart.CanCollide = false
					local Attachment0, Attachment1 =Instance.new("Attachment"), Instance.new("attachment")
					Attachment0.CFRAME = v.C0
					ball.attachment = ball.attachment -attachment 
					Attachment0.Parent = v.Part0
					ball.attachment = ball.attachment -attachment 
					local BallSocketConstraint = Instance.new("BallSocketConstraint")
					BallSocketConstraint.Attachment0 = Attachment0
					BallSocketConstraint.Attachment1 = Attachment1
					BallSocketConstraint.Parent = v.Parent
					
					v:Destroy()
			   end
			end)
		   Character.HumanoidRootPart.CanCollide = false
       end)
    end)
end)

Thats just a fix that I made for the instances.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.