Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
If your talking about the layout, probably use an algorithm like Wave Function Collapse or another constraint satisfaction algorithm. You would probably need to do your own research and your own implementation as WFC is a bit complicated and there isn’t much documentation on how to implement it in Roblox. I definitely recommend The Coding Train’s tutorial on YouTube on this if you’re going with WFC as he explains the concept perfectly.
If you already have the layout and just need to fill in the rooms, just make a bunch of room/hallway templates and randomly insert them into each section/space in the layout.