Basically, I am trying to spawn this part around a specific region on a map. I tried using Vector values to spawn the part but it still does not work. Instead of spawning in between that region, the piece only spawns on the positions. Help Is Appreciated and UpVoted! This is my following code:
01 | local GrassIsCutted = false |
03 | local OriginalPiece = game.ServerStorage.OriginalPart |
05 | local positionsTable = { Vector 3. new(- 59.5 , 1.5 , - 23.5 ), Vector 3. new(- 59.5 , 1.5 , 26.5 ),Vector 3. new(- 8.23 , 1.5 , 26.467 ),Vector 3. new(- 8.5 , 1.5 , - 23.5 ) } |
07 | function duplicatePiece() |
09 | math.randomseed(tick()) |
10 | local position = positionsTable [ math.random( 1 ,#positionsTable) ] |
12 | local clonedPiece = OriginalPiece:Clone() |
14 | clonedPiece.Position = position |
15 | clonedPiece.Parent = game.Workspace |
I placed the OriginalPiece in the ServerStorage by the way. Thank you for taking your time to read and debug this. :)