01 | local Coin = game.ServerStorage.Coin |
05 | local Base = game.Workspace.Base |
07 | local function GetPos() |
08 | local X_Size = Base.Size.X |
09 | local Z_Size = Base.Size.Z |
11 | local Max_X_Pos = Base.Position.X + X_Size |
12 | local Max_Z_Pos = Base.Position.Z + Z_Size |
14 | local Min_X_Pos = Base.Position.X - X_Size |
15 | local Min_Z_Pos = Base.Position.Z - Z_Size |
17 | return math.random(Min_X_Pos, Max_X_Pos), math.random(Min_Z_Pos, Max_Z_Pos) |
21 | local NewCoin = Coin:Clone() |
22 | NewCoin.Parent = game.Workspace |
25 | NewCoin.Position = Vector 3. new(X, Y, Z) |
I haven't tested it, just came up with it. Hopefully it works!