Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetTimeUntilAutoRespawn

From RoR Wiki

UI Lua API · Game functions
Version: WAR 1.4.8

Returns how long it is until the dead player is respawned automatically.

seconds = GetTimeUntilAutoRespawn()

Arguments

None.

Returns

seconds
number – Seconds left until the automatic respawn, or 0 if the time is up. Not a whole number in general.

Details

  • The client stores the respawn time as a point in time and subtracts the current time on each call.
  • The stock UI only calls the function when the player's hit points are 0.
  • If the Lua state is not available, the function returns nothing.

Errors

None.

Example

From default/ea_deathwindow/source/deathwindow.lua:

if GameData.Player.hitPoints.current == 0
then
    DeathWindow.OnPlayerDeath( GetTimeUntilAutoRespawn() )
end