I’m trying to make it so that when the player exits ragdoll, they don’t jump. I’ve searched on devforum and found out about turning off FallingDown and Ragdoll humanoid state types but that only prevents the player from being flung after ragdoll. Now that the player can’t be flung, they just jump really high into the air.
This is how it works:
How can I prevent this?
This is the server code to reset ragdoll:
function resetJoints()
ClientRagdoll:FireAllClients(Character,false)
if Humanoid.Health < 1 then return end
for _, instance in pairs(Character:GetDescendants()) do
if ragdollInstanceNames[instance.Name] then
instance:Destroy()
end
if instance:IsA("Motor6D") then
instance.Enabled = true;
end
end
Humanoid.AutoRotate = true
task.wait(1)
--Humanoid:SetStateEn
This is the client code:
RagdollValue:GetPropertyChangedSignal("Value"):Connect(function()
if (Humanoid.Health == 0) then --> Prevents OOF sound from playing twice thanks to @robloxdestroyer1035
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
push()
return
end
if RagdollValue.Value then
--Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
Humanoid:ChangeState(Enum.HumanoidStateType.FallingDown)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
push()
elseif not RagdollValue.Value then
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end)
Thank you for the suggestion, however, the player is still jumping after ragdoll. A temporary solution would be to use RunService to set the Y axis of the AssemblyLinearVelocity to 0 for a set amount of time after the player leaves ragdoll mode. I don’t think this is a good solution though, do you have any other ideas?
function resetJoints()
ClientRagdoll:FireAllClients(Character, false)
if Humanoid.Health < 1 then return end
for _, instance in pairs(Character:GetDescendants()) do
if ragdollInstanceNames[instance.Name] then
instance:Destroy()
end
if instance:IsA("Motor6D") then
instance.Enabled = true
end
end
Humanoid.AutoRotate = true
Humanoid.JumpPower = 0
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
task.wait(0.5)
Humanoid.JumpPower = 50
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
end
Client-Side
RagdollValue:GetPropertyChangedSignal("Value"):Connect(function()
if Humanoid.Health == 0 then
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
return
end
if RagdollValue.Value then
Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
else
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
Humanoid.JumpPower = 0
task.wait(0.5)
Humanoid.JumpPower = 50
end
end)