HumanoidStateType

Something like this, works?

if not Char.Humanoid.HumanoidStateType == Enum.HumanoidStateType.Dead then
–rest of the code
end

1 Like

Why not try it.

But I will tell you that it doesn’t work.

Because not has higher precedence over == so it is evaluated as false == Enum.HumanoidStateType.Dead.

if Char.Humanoid.HumanoidStateType ~= Enum.HumanoidStateType.Dead then
    -- ...
end

Error: [HumanoidStateType is not a valid member of Humanoid] :confused:

Ah. You need to use the :GetState method of Humanoids to get the current state of it.

if humanoid:GetState() == Enum.HumanoidStateType.Dead then
    -- ...
end

:stuck_out_tongue:

1 Like

Thank you so much, this works, you helped me, much, in my gravity coil script <3