Scripts from VX ACE to MZ, Random Dungeon Room generator

Hey! I'm tinkering a little Rogue like in MZ together and have found a tutorial for a random map generation

https://forums.rpgmakerweb.com/inde...me-like-binding-of-isaac.117790/#post-1036430

the user uses a few scripts:

$gameVariables[5] =

[4,5,6]

$gameVariables[5].shuffle!

this sets the variable with the ID 5 to the value 4,5 or 6

and
$game_variables[5][$game_variables[6]]
adds the variable ID:5 with the variableID: 6



but since the tutorial is for VX ACE, these scripts don't work anymore in MZ

can someone translate these little scripts? i'm honestly a bit overwhelmed^^

if someone has a better tutorial or idea for the dungeon generation i will gladly accept help!
Thanks in Advance!
I have moved this thread from RPG Maker MZ Support to JS Plugin Requests.

Original thread: https://forums.rpgmakerweb.com/threads/scripts-from-vx-ace-to-mz-random-dungeon-room-generator.162091/