cs-os/scripts/Select.gd

26 lines
724 B
GDScript

extends Button
@onready var button = $"."
@onready var choose_team = $"../.."
@onready var choose_class_os = $"../../../Choose_class_OS"
@onready var choose_class_cs = $"../../../Choose_class_CS"
func _ready():
button.pressed.connect(self._button_pressed)
func _button_pressed():
match name:
"Select_CS":
choose_class_cs.visible = true
choose_class_os.visible = false
"Select_OS":
choose_class_os.visible = true
choose_class_cs.visible = false
"Select_SP":
print("Spectating")
Networking.choose_class.rpc_id(1, multiplayer.get_unique_id(), 0)
_:
var class_id = int(name.split("_")[1])
Networking.choose_class.rpc_id(1, multiplayer.get_unique_id(), class_id)
choose_team.visible = false