Skip to content

Unable to damage players while in SetPedToRagdoll loop #3750

@TheRealBablo

Description

@TheRealBablo

What happened?

When a player ped is continuously forced into ragdoll using SetPedToRagdoll in a loop, the ped becomes effectively immune to all weapon damage from guns.
While ragdolling, the player cannot be damaged by firearms at all. The only ways to kill or damage the player are via explosions (e.g. C4) or by blowing the ped up entirely.

This happens consistently as long as SetPedToRagdoll is being called repeatedly.

The issue does not appear to be weapon-specific — all firearms fail to deal damage.

Expected result

Players should still be able to take normal weapon damage (e.g. bullets) while in a ragdoll state created via SetPedToRagdoll, similar to how NPCs or naturally ragdolled peds behave. Being in ragdoll should not make a player invulnerable to gun damage.

Reproduction steps

RegisterCommand('ragdoll', function()
    if Main and Main.disableModules then return end
    if IsPedInAnyVehicle(cache.ped, false) then return end

    if not isRagdolling then
        isRagdolling = true
    else
        isRagdolling = false
    end

    Citizen.CreateThread(function()
        while isRagdolling do
            SetPedToRagdoll(cache.ped, 1000, 1000, 0, 0, 0, 0)

            Citizen.Wait(5)
        end
    end)
end)

coded this

  1. trigger ragdoll on a players client
  2. another player tries to kill the player that is ragdoll but it wont take any damgages evan tried by making a loop that showed player health shooting it multiple times did nothing health still at 200

Importancy

Slight inconvenience

Area(s)

FiveM

Specific version(s)

tried on 20035 and latest(23918)

Additional information

A tried on to artifacts
20035 and latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageNeeds a preliminary assessment to determine the urgency and required action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions