How would I make a player sit if fell from a high place

I want to make a player sit if it fell from a high place but i don’t know how to!
I want to make the player sit so i can use it for my ragdoll that ragdoll when the player sits.

1 Like

Have you tried looking around the forum and the Developer Hub for help and insight?
Here a few links that may help: Humanoid | Roblox Creator Documentation, Humanoid | Roblox Creator Documentation, Humanoid | Roblox Creator Documentation

As for your question, I suggest that you keep track of the player’s humanoid states and check when it changes. Using the StateChanged event, you can use the 2 parameters (old, new) to find the previous and current humanoid states, Since you haven’t specified, I assume that the player falls from a certain height and touches the ground, in this case, the old state must be freefalling and the new state must be landed. As for finding this ‘high place’, I suggest you check the Y position of the HumanoidRootPart before and after the humanoid has changed into the respective states. Find the difference between these Y positions, and then use some arbitrary number to compare in terms of height. If the comparison is satisfied, you can force the humanoid to sit, but I’ll leave that up to you to implement :slight_smile:

Here are some resources regarding the sit aspect, not sure how you’re planning on doing it: Seat | Roblox Creator Documentation, Humanoid | Roblox Creator Documentation

some pseduo-code:

local yPos = 1000
local originalPos

humanoid.StateChanged:Connect(function(oldState, newState)
	if humanoid:GetState() == Enum.HumanoidStateType.Freefall then -- Check if current state is Freefalling
		originalPos = rootPart.Position.Y -- get original Y position
	end
	if oldState == Enum.HumanoidStateType.Freefall and newState == Enum.HumanoidStateType.Landed then -- check the old and new state 
		if originalPos - rootPart.Position.Y >= yPos then
			-- Force player to sit
		end
	end
end)

Btw, next time do provide more information and be more specific as limited context limits the help you can get .

1 Like