01 | while true do |
02 | local sides = script.Parent.Folder |
03 | local Left = sides:FindFirstChild( "Left" ) |
04 | local Right = sides:FindFirstChild( "Right" ) |
05 | local Up = sides:FindFirstChild( "Up" ) |
06 | local Down = sides:FindFirstChild( "Down" ) |
07 | wait( 0.2 ) |
08 | local side 2 pic = math.random( 1 , 4 ) |
09 | if Left or Right or Up or Down then |
10 | if side 2 pic = = 1 then |
11 | if Left then |
12 | local partclone = game.Lighting.PartOfMap:Clone() |
13 | wait() |
14 | partclone.Part.Anchored = true |
15 | partclone.Part.Size = Vector 3. new( 15.86 , math.random( 0.05 , 3 ), 19.21 ) |
it only spawns parts that go left, and doesn't spawn in other directions
I'm not going to dignify this with a proper analysis for areas you can improve, which there are a lot of.
You're only generating Left pieces because you aren't end
ing the if Left then
, if Down then
, if Right then
, or if Up then
statements before starting the elseif side2pic = ...
statements.
Basically, your ends don't line up. This would be a lot more obvious if you indented your code properly.