Ragdoll on fall script help

I am trying to make a script which ragdolls the player if they have been falling for a certain amount of time.

hum.FallingDown:Connect(function(IsActive)

	if IsActive == true then
		warn("player falling")
		wait(FallTime)
		if IsActive == true then
		rm:Ragdoll(char)
		rag = true

	if IsActive == false then
		if rag == true then
		wait(getuptime)
		rm:Ragdoll(char)

Problem Is, The “IsActive” Boolean is still active even if the player isn’t falling. I’ve tried using velocity instead if this but i couldn’t figure it out. Any Solutions?

There is nothing in this script that defines what the value of rm is.

1 Like

rm is the ragdoll module I required. i cut out parts of the script because most of it was just variables or end thingys but thank you for replying

you should use number value for that and maybe one more variable to check if its falling or not

local thread = 0

hum.FallingDown:Connect(function(IsActive)
    thread += 1
    local currentThread = thread    

	if isFalling == true then
		warn("player falling")
		wait(FallTime)
		if thread == currentThread then
        thread = 0
		rm:Ragdoll(char)
		rag = true

	if IsActive == false then
		if rag == true then
		wait(getuptime)
		rm:Ragdoll(char)
end)
1 Like