Working on Coin generation system, this is my current script:
local Region = workspace.Region
local ServerStorage = game:GetService("ServerStorage")
local Coin = ServerStorage.Coin
local x = Region.Position.x
local z = Region.Position.Z
local coins = 0
while coins < 10 do
local newcoin = Coin:Clone()
newcoin.Parent = workspace
local pos1 = math.random(x,z)
local pos2 = math.random(x,z)
newcoin.Position = Vector3.new(pos1,3,pos2)
wait(3)
end
This just spawns the coins randomly between the numbers like 8 and 50, which is not what I want. I think my brain is just too tired. I was hoping their was an easier method, or what is more practical to use. Any ideas what I could do to get the coins to spawn in a region (another part)