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?
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)