Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Ragdoll script making player fly up?

Hey there, I've been stuck on trying to find a fix for this issue for awhile now and not sure what is causing it to behave this way?

Basically once the player is ragdolled they are getting pulled up as if by force into the air.

Script:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local human = char:WaitForChild("Humanoid")
		for _, v in pairs(char:GetDescendants()) do
			if v:IsA("Motor6D") then 
				local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
				a0.CFrame = v.C0
				a1.CFrame = v.C1	
				a0.Parent = v.Part0
				a1.Parent = v.Part1
		
				local ball = Instance.new("BallSocketConstraint")
				ball.Attachment0 = a0
				ball.Attachment1 = a1
				ball.Parent = v.Part0

				char:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.Physics)
				char.HumanoidRootPart.CanCollide = false
				v.Enabled = false
			end
		end
		
		wait(10)
		local human = char:WaitForChild("Humanoid")
		for _, v in pairs(char:GetDescendants()) do
			if v:IsA("Motor6D") then
				v.Enabled = true
				char:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.GettingUp)
			end
		end
	end)
end)

Any help is appreciated!

1 answer

Try changing the state types on line 17 and 28

Here's a list of state types that you can test out.

4 comments

0

Tried all logical ones, Nothing worked.

0

Maybe anchor the HumanoidRootPart, and if needed, the rest of the body parts?

0

That just results in not giving it a ragdoll effect, Does stop the flying tho

0

Add a wait() in between ragdolling the humanoid and freezing it

This discussion is preserved as it was. New answers, comments, and votes are closed.