local chosen_team = ui.new_combobox( "Misc", "Miscellaneous", "Automatically choose team", { "Off", "Counter-Terrorists", "Terrorists" } )
local function join( )
if ui.get( chosen_team ) == "Counter-Terrorists" then
client.exec( "jointeam 3 1" )
elseif ui.get( chosen_team ) == "Terrorists" then
client.exec( "jointeam 2 1" )
end
end
client.set_event_callback( "player_connect_full", function( event_data )
if client.userid_to_entindex( event_data.userid ) == entity.get_local_player( ) then
client.delay_call( 0.1, join ) -- Because yes
end
end )