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

How to make the player ragdoll when they take damage?

Pretty much the title. Im trying to get the player to enter the ragdoll state after taking some damage

1 answer

You didn't post any script so I'll only give you the basics.

You'd utilize the HealthChanged event within the humanoid and calculate if the player's current health is lower than before, if so you'll know they took damage and you'd ragdoll them.

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local currentHealth = humanoid.Health
		character:WaitForChild("Humanoid").HealthChanged:Connect(function(health)
			if currentHealth > health then
				--// Ragdoll
			end
			currentHealth = health
		end)
	end)
end)

The rest you can figure out on your own. Also, next time please make an attempt at making your own scripts before asking questions here.

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