Selecting random obstacles from Server Storage?
Asked by
5 years ago Edited 5 years ago
Let me explain what this is. So, basically what happens is:
ServerStorage >
Clones >
Stage1C >
Set1
Set2
Set3
Set4
basically it selects 1 of the Set1,2,3, and 4. Each set inside has several obstacles across the entire map that are displayed for players to run. I don't want it to work that way anymore, how can I make it so that it goes to each Set but instead of selecting the entire set and all children inside, it only selects 1 child inside each set and places them all in the course for the player to play?
my apologies if I didn't give enough info. If you need more help understanding here is a picture of where I place all 4 sets:
https://imgur.com/55YFdzE
and inside each set, there will be 4 obstacles that every round 1 of them shows visible for the player to run throughout the course.
1 | Core.Stage:ClearAllChildren(); |
3 | local randStageMap = game:GetService( "ServerStorage" ):FindFirstChild( "Clones" ):WaitForChild( "Stage" ..stageNumber.. "C" ):GetChildren() |
4 | local actualMap = randStageMap [ math.random( 1 ,#randStageMap) ] :Clone() |
5 | actualMap.Parent = Core.Stage |
6 | for _,obj in pairs (Stage:GetChildren()) do obj.Parent = Core.Stage; end ; |