really good after you get it working. I will help you:
Import in the script to OBS
open the script and edit line 6 instead of obs.OBS_INVALID_HOTKEY_ID, make it obs.random_hotkey. Now in the "text source", box in the scripts menu, put the name of the scene where you have all the sources, and then go into the OBS hotkeys and you will see random_hotkey in the main list at the top, this will trigger the script.