client
SetEntityInvincible
FiveM client native documentation with a Lua example.
Summary
Toggles invincibility (god mode) for an entity. Used for admin tools, safe zones, and cutscenes.
Returns
void
Parameters
entitynumberThe entity handle.togglebooleantrue = invincible, false = normal.Example
local ped = PlayerPedId()
SetEntityInvincible(ped, true) -- god mode on
-- ... later
SetEntityInvincible(ped, false) -- offCommon pitfalls
- Setting player invincibility client-side can be flagged by anti-cheats — gate admin use properly.
- Remember to turn it back off; leaving it on is a common bug in safe zone scripts.
- This is exactly the kind of logic our Viper Safezones handles cleanly.
Related natives
Related guides
Need protected areas on your map?
Viper Safe-Zone draws polygon safe zones in-game — no hand-edited coordinates — with weapon, combat and vehicle-speed rules per zone.
See Viper Safe-Zone →