I’ve been trying to create a ragdoll on death with features such as, player body stays and decays after a minute, death animation and some other smaller features. I’ve been using Humanoid:ChangeState(Enum.HumanoidStateType.Physics) to make the ragdoll and hum:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false) to stop the player from getting up. Keep in mind that the player is dead. I don’t know if it’s engine bug but I’ve had to fight the script as it’s completely ignoring it and my other filters.
I’ve tried may fixes, such as running the script on the client and the server and done my research online to find other people having similar-ish problems from years ago.
Pic of my console
Local Script
local Ragdolls = workspace:WaitForChild("Ragdolls")
for _,v in pairs(Ragdolls:GetChildren()) do
local hum = v:FindFirstChild("Humanoid")
hum:SetStateEnabled(Enum.HumanoidStateType.Physics, true)
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
hum:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
hum:SetStateEnabled(Enum.HumanoidStateType.Running, false)
hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
hum:ChangeState(Enum.HumanoidStateType.Physics)
hum.StateChanged:Connect(function(oldstate, newstate)
print(oldstate,newstate)
hum:SetStateEnabled(Enum.HumanoidStateType.Physics, true)
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
hum:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
hum:SetStateEnabled(Enum.HumanoidStateType.Running, false)
hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
hum:ChangeState(Enum.HumanoidStateType.Physics)
print(hum:GetState())
end)
end
Even after all of this, the player is trying to get up (as seen above in the console).
If anyone has any alternatives or fixes, please let me know.