How do i change tabs in a tab container from outside the scene?

Godot Version

Godot 4.2.1


Basically, i have my main scene called Menu with 3 rows of buttons, and in each row there are a bunch of buttons, now row of buttons navigates to a specific scene, and each button in the row navigates to a specific tab in that scene

For example, here is the progression:
Main Menu Scene → First Row → First Button = First Tab of the First Scene
Main Menu Scene → First Row → Second Button = Second Tab of the First Scene

ect ect’

I have tried to achieve this by using groups and calling the TabContainer in each scene but i havent figured it out yet, ChatGPT mentioned calling the ready() method of the First Scene in the Main Menu Scene and use that

Here is a code snippet:

extends ScrollContainer

# Define a variable to store the tab index
var selected_tab_index : int = 0

func _on_basic_button_pressed():
	# Set the tab index for Basic Tab
	selected_tab_index = 0
	# Load Basic Tab

func _on_privilege_button_pressed():
	# Set the tab index for Privilege Level Tab
	selected_tab_index = 1
	# Load Privilege Level Tab

func _on_ssh_button_pressed():
	# Set the tab index for SSH Tab
	selected_tab_index = 2
	# Load SSH Tab

func _on_telnet_button_pressed():
	# Set the tab index for Telnet Tab
	selected_tab_index = 3
	# Load Telnet Tab

func load_tab_scene():
	# Load the scene into the TabContainer
	var tabContainer = $UserLevel/TabContainer
	if tabContainer:
		tabContainer.current_tab = selected_tab_index

func change_tab():
	get_tree().call_group("Group", "ChangeTab")

Any help would be very appreciated, Thanks!