25 lines
927 B
GDScript
25 lines
927 B
GDScript
|
extends Control
|
||
|
|
||
|
@onready var main = get_tree().get_root().get_node("Main")
|
||
|
|
||
|
# Declare member variables here. Examples:
|
||
|
# var a = 2
|
||
|
# var b = "text"
|
||
|
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
pass # Replace with function body.
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _process(delta):
|
||
|
# if main.local_player == null: # player is dead ATM
|
||
|
# print("local_player is null; PID is ", get_tree().multiplayer.get_network_unique_id(),"; respawn queue: ", main.respawn_queue)
|
||
|
if main.spawn_queue.has(get_tree().multiplayer.get_network_unique_id()):
|
||
|
var countdown = main.spawn_queue[get_tree().multiplayer.get_network_unique_id()] - main.uptime
|
||
|
# countdown = round(countdown * 10) / 10
|
||
|
$RespawnCountdown.text = "RESPAWNING IN " + str("%1.2f" % countdown) + " SECONDS..."
|
||
|
$RespawnCountdown.visible = true
|
||
|
else:
|
||
|
$RespawnCountdown.visible = false
|