RevivePlayer

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

revivePlayer

Returns a downed or dead player to the authoritative alive state.

Syntax

bool revivePlayer(int playerId [, number health = 10])

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
health number no Positive health restored on revive; defaults to 10.

Returns

Returns true when the revive is accepted; otherwise returns false.

Examples

Revive a player with 25 health:

if isPlayerDowned(playerId) or isPlayerDead(playerId) then
    revivePlayer(playerId, 25)
end

Notes

  • Available only in server-side resource scripts.
  • Reviving unlocks movement, updates authoritative health, and emits the life-state change and revive events.