right so i have 8 folders and a brick so when someone touches a brick I want it to randomly select something from the folder and put it into the workspace. At the moment I have this inserted in a brick and have no idea why it doesn't work.
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
--first room random
local maproom1 = game.Lighting.Room1
local chosenmap = maproom1[math.random(1, #mapsinserverstorage)]
chosenmap:Clone().Parent = game.workspace.MapStorage
end
script.Parent.Touched:connect(onTouch)

4 comments
where are the folders located?
lighting
game:GetService("Lighting"):GetDescendants()
You should not be using lighting for storage. And use workspace or game.Workspace, as game.workspace is deprecated