client
SetEntityHealth
FiveM client native documentation with a Lua example.
Summary
Sets an entity's health. Common for healing or damaging peds. Use GetEntityMaxHealth to fully heal.
Returns
void
Parameters
entitynumberThe entity handle.healthnumberThe health value to set.Example
local ped = PlayerPedId()
SetEntityHealth(ped, GetEntityMaxHealth(ped)) -- full healCommon pitfalls
- Setting health to 0 kills the ped.
- Health/anti-cheat: setting player health client-side can be flagged; do healing through trusted logic on serious servers.
Related natives
Related guides
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →