Selected folder not cloning parts only the parents of them

Random map is only cloning folders and models
Im trying to make a randomised map system stored in a folder that has all the maps.
The folder is only cloning folders and models not parts
ive tried many solutions but I haven’t found one

local maps = game.ReplicatedStorage.Maps:GetChildren()

local randommap = Maps[math.random(#Maps)]
local selectedmap = randommap:Clone()
selectedmap.Parent = workspace

this has been going on for a while and I desperately need a fix to this

Maybe check if the things that are not getting cloned have .Archivable set to false. When it’s false it doesn’t get cloned.

Ive tried doing that and they have archived on when I checked them

Well I can’t really say for sure what the problem is, but maybe it’s this typo?

Maybe “Maps” was meant to be “maps” since you declared the variable with a lowercase M and it is instead accessing another variable… or is it just a typo in your forum post?

sadly its a typo the codes fine its just the cloning part

Does your Maps have parts on their own?

Or what your Maps are organized as, are they organized as Folders?

I just tested it and the only issue with this is the typo. Is there even a variable that is called “Maps” (With the uppercase M)? If not you should be getting an error. What if you tried this exact snippet right here?

local maps = game.ReplicatedStorage.Maps:GetChildren()

local randommap = maps[math.random(#maps)]
local selectedmap = randommap:Clone()
selectedmap.Parent = workspace

Changing the uppercase M into a lowercase m fixed it for me, so I dont see any other issues with this. Unless there is an issue with a part of the script that you didn’t upload.

no everything’s fine with it on the script its a forum typo. it only clones folders and models.

My maps are put in a folder, the maps have folders for each type of model like trees and such. its just it not cloning parts

There’s nothing wrong with the code, its the cloning that’s the problem.

Use Models instead of Folders and tell me the result

“if selectedMap.PrimaryPart then selectedMap:SetPrimaryPartCFrame(CFrame.new(0, 0, 0))”

Nevermind, found the solution just had to put the map in server storage because it took up too much memory when loading in

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.