using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /Verse.org/Random } # This is our script. It runs when the game starts. MyRandomDungeon := class(creative_device): # These are the rooms. They are creative_prop devices. # You must link these in the editor properties. @editable RoomA : creative_prop = creative_prop{} @editable RoomB : creative_prop = creative_prop{} @editable RoomC : creative_prop = creative_prop{} # This is the main event. It runs once when the game starts. OnBegin() : void = # 1. Pick a random number between 1 and 3. # GetRandomInt returns a value in the range [Low, High] inclusive. Choice : int = GetRandomInt(1, 3) # 2. Hide all rooms first. # We start with a blank slate. RoomA.Hide() RoomB.Hide() RoomC.Hide() # 3. Show the room that was picked. # We use an 'if' statement. It asks a question. if (Choice = 1): RoomA.Show() else if (Choice = 2): RoomB.Show() else: # If it's not 1 or 2, it must be 3. RoomC.Show()