extends Panel var players_selected = {} func _ready(): self.set_Wait_text() func set_Wait_text(): $Wait.text = "Waiting for " + str(Network.get_player_count() - self.players_selected.size()) + " players to choose" func _button_pressed(event, character): if event is InputEventMouseButton or event is InputEventKey: if event.pressed: rpc("_character_selected", character) Network.player.character = character sync func _character_selected(character): var id = get_tree().get_rpc_sender_id() if Network.players.has(id): Network.players[id].character = character self.players_selected[id] = true self.set_Wait_text() if Network.get_player_count() == self.players_selected.size(): get_tree().change_scene("res://UI/LevelSelect.tscn")