How would I allow a player to move while ragdolled?

I have a script but I want the player to be able to move while Ragdolled
Script:

local replicatedStorage = game:GetService("ReplicatedStorage")


local function ragdollChar(character, humanoid)
	
	humanoid.AutoRotate = false
	humanoid.AutoRotate = true
	humanoid.PlatformStand = false

	humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
	--humanoid.
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
	humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)
	
	for i, v in pairs(character:GetDescendants()) do

		if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then

			local attach0 = Instance.new("Attachment")
			attach0.CFrame = v.C0
			attach0.Parent = v.Part0

			local attach1 = Instance.new("Attachment")
			attach1.CFrame = v.C1
			attach1.Parent = v.Part1

			local BallSocketConstraint = Instance.new("BallSocketConstraint")
			BallSocketConstraint.Parent = v.Parent
			BallSocketConstraint.Name = v.Name
			BallSocketConstraint.Attachment0 = attach0
			BallSocketConstraint.Attachment1 = attach1
			BallSocketConstraint.LimitsEnabled = true
			BallSocketConstraint.TwistLimitsEnabled = true
			BallSocketConstraint.Enabled = true
			v.Enabled = false

		elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
			v.CanCollide = false
		end

		humanoid.AutoRotate = false
		character.HumanoidRootPart.CanCollide = false

	end



end

replicatedStorage:WaitForChild("RagdollPlayer").OnClientEvent:Connect(function()
	
	ragdollChar(game.Players.LocalPlayer.Character, game.Players.LocalPlayer.Character:FindFirstChild("Humanoid"))
	
	
end)
2 Likes

There are a few options for this
All options require you to use UserInputService

  1. Apply a VectorForce to the avatar based on UIS
  2. CFrame the avatar based on UIS

thats too hard lol :skull::skull::skull:
theres gotta be another option right

you mean, u want to them to only be visually ragdolled, but in reality they can still move? like normal character?

Well yeah I could do that too (thirtychars)

robloxapp-20230326-1105589.wmv (1.7 MB)
i tried ur script , its working isnt it?
sorry for bad quality

What is your server script? Can you send me it?
This is mine:

           char.Humanoid.WalkSpeed = 50
			char:PivotTo(script.Parent:WaitForChild("TeleportPart").CFrame)
			
			local frame = char.PrimaryPart.CFrame.LookVector
			
			local bodyV = Instance.new("BodyVelocity")
			bodyV.Parent = char.PrimaryPart
			bodyV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
			bodyV.Velocity = frame*(Force+math.random(-Force, Force))
			spawn(function()
				wait(stayTime)
				bodyV:Destroy()
			end)

			game.ReplicatedStorage.RagdollPlayer:FireClient(game.Players:GetPlayerFromCharacter(char))

Also the bad quality is fine I don’t really care

i didnt use remote events so i had to tell the script about the character and humanoid variable



task.wait(5)
print("ragdoll")

local function ragdollChar(character, humanoid)

	humanoid.AutoRotate = false
	humanoid.AutoRotate = true
	humanoid.PlatformStand = false

	humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
	--humanoid.
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
	humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)

	for i, v in pairs(character:GetDescendants()) do

		if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then

			local attach0 = Instance.new("Attachment")
			attach0.CFrame = v.C0
			attach0.Parent = v.Part0

			local attach1 = Instance.new("Attachment")
			attach1.CFrame = v.C1
			attach1.Parent = v.Part1

			local BallSocketConstraint = Instance.new("BallSocketConstraint")
			BallSocketConstraint.Parent = v.Parent
			BallSocketConstraint.Name = v.Name
			BallSocketConstraint.Attachment0 = attach0
			BallSocketConstraint.Attachment1 = attach1
			BallSocketConstraint.LimitsEnabled = true
			BallSocketConstraint.TwistLimitsEnabled = true
			BallSocketConstraint.Enabled = true
			v.Enabled = false

		elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
			v.CanCollide = false
		end

		humanoid.AutoRotate = false
		character.HumanoidRootPart.CanCollide = false

	end



end
ragdollChar(script.Parent, script.Parent.Humanoid)

this is inside startercharacterscript (so its inside the character)

When I use that code, I can’t move my character at all… I don’t know if it’s the game’s properties or what, but if it is, what is your game avatar properties

its a normal baseplate game, nothing changed in avatars

hmm
im going to try it in another game and see what happens

This is weird. I’ve created and empty baseplate, copied your script in, and I couldn’t move.

Testing Baseplate.rbxl (47.5 KB)
this is the game copy, dont mind the other script, i use those to test other player’s problems, if this still dont work, im afraid i dont have clue of whats going on in ur studio

Ok. It works. But you see how when you jump, it floats you up into the air? That’s my main problem and why I tried to change the script. Why does it float into the air?

this method of ragdoll is very buggy and roblox dont seem to want to fix it, but theres no other ragdoll methods as visually good at this, as for me, i just settled to animated ragdoll, its not visually good but it dont throw me into the sky

ok yeah i should probably do that. kind of ruins the game but i guess its the only way to do it

local function ragdollChar(character, humanoid)
		humanoid.BreakJointsOnDeath = false
	humanoid.RequiresNeck = false

	humanoid.AutoRotate = false
	humanoid.PlatformStand = false

		humanoid:ChangeState(Enum.HumanoidStateType.Physics)

	
	for i, v in pairs(character:GetDescendants()) do

		if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then

			local attach0 = Instance.new("Attachment")
			attach0.CFrame = v.C0
			attach0.Parent = v.Part0

			local attach1 = Instance.new("Attachment")
			attach1.CFrame = v.C1
			attach1.Parent = v.Part1

			local BallSocketConstraint = Instance.new("BallSocketConstraint")
			BallSocketConstraint.Parent = v.Parent
			BallSocketConstraint.Name = v.Name
			BallSocketConstraint.Attachment0 = attach0
			BallSocketConstraint.Attachment1 = attach1
			BallSocketConstraint.LimitsEnabled = true
			BallSocketConstraint.TwistLimitsEnabled = true
			BallSocketConstraint.Enabled = true
			v.Enabled = false

		elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
			v.CanCollide = false
		end

		humanoid.AutoRotate = false
		character.HumanoidRootPart.CanCollide = false

	end



end

Upon unragdolling the character change its state to this. humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

When I do that then the ragdoll floats up into the air.
Look at When player is ragdolled they will sometimes get pushed up - #4 by 43x12is516 to see the example

It’s been a long time but for anyone reading, first set character collisions off so your character or other characters dont collide with each other and make you fly. Afterwards i used this script and made sure to set humanoidstateType to ragdoll. Here’s the script:

        humanoid.BreakJointsOnDeath = false
		humanoid.RequiresNeck = false
		humanoid.AutoRotate = false
		humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)

		for i, v in pairs(character:GetDescendants()) do
			if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
				local attach0 = Instance.new("Attachment")
				attach0.CFrame = v.C0
				attach0.Parent = v.Part0

				local attach1 = Instance.new("Attachment")
				attach1.CFrame = v.C1
				attach1.Parent = v.Part1

				local BallSocketConstraint = Instance.new("BallSocketConstraint")
				BallSocketConstraint.Parent = v.Parent
				BallSocketConstraint.Name = v.Name
				BallSocketConstraint.Attachment0 = attach0
				BallSocketConstraint.Attachment1 = attach1
				BallSocketConstraint.LimitsEnabled = true
				BallSocketConstraint.TwistLimitsEnabled = true
				BallSocketConstraint.Enabled = true
				v.Enabled = false

			elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
				v.CanCollide = false
				v.Massless = true
			end

			humanoid.AutoRotate = false
			character.HumanoidRootPart.CanCollide = false