Skip to main content

PedSetHealth

Description​

Will raise max health if set higher than their current max health.

function PedSetHealth(id, health) --[[ ... ]] end

Parameters​

  • id: integer - The ped's model ID.
  • health: number - The ped's health value.

Return Values​

None.

Example​

Heal a ped (assumed to already exist) by 100 health points without affecting their max health.

local health = PedGetHealth(ped) + 100

if health > PedGetMaxHealth(ped) then
health = PedSetMaxHealth(ped)
end
PedSetHealth(ped, health)