Answered by
pwx 1581
2 years ago
Well this all depends on how random you wish to have it.
Do you want it randomized on a set of coordinates? If so then you want:
1 | local randomCoordinates = { { 5 , 2 , 5 } , { 0 , 0 , 0 } , { 242 , 242 , 2525 } , { 242 , 4242 , 242 } } |
4 | local Part = Instance.new( 'Part' ) |
5 | local randomCoordinate = randomCoordinates [ math.random( 1 ,#randomCoordinates ] ) |
6 | local X, Y, Z = randomCoordinate [ 1 ] , randomCoordinate [ 2 ] , randomCoordinate [ 3 ] |
7 | Part.CFrame = CFrame.new(X, Y, Z) |
Do you want it constantly random regardless of where it spawns?
1 | local Part = Instance.new( 'Part' ) |
2 | local X, Y, Z = math.random( 1 , math.huge ), math.random( 1 , math.huge ), math.random( 1 , math.huge ) |
3 | Part.CFrame = CFrame.new(X, Y, Z) |