Greetings, today i'm trying to make a game similar to epic mining 2 and much other games similar to that. I'm trying to create the mine ore, dirt, stone etc generation within a certain position (scattered). The only thing is that I don't know how I can script it. I'm not begging or anything but i've started a little bit of the script. This may infact make me learn more about my lua knowledge and on mining games, probably going to make a tutorial how you can make one in the future.

Anyways, here's the script (a bit of it, hopefully it makes sense.)

local DirtLayer = {60, 199, 60}
local DirtSize = {4,4,4}

local StoneLayer = {60,200,60}
local StoneSize = {4,4,4}

local Lithosphere = {60,2200,60}
local HotStone = {4,4,4} -- Requires Heat Protection aswell as O2.

local Asthenosphere = {60,3300,60}
local Magma = {4,4,4}

local Underworld = {60,6660,60}
local Hellstone = {4,4,4}

--Ores

local Coal = 1 -- Rarity
local CoalSellValue = 22

local Copper = 1 -- Rarity
local CopperSellValue = 29

local Lead = 1 -- Rarity
local LeadSellValue = 35

local Nickel = 1.5 -- Rarity
local NickelSellValue = 67

local Iron = 1.1 -- Rarity
local IronSellValue = 67

local Silver = 1.6 -- Rarity
local SilverSellValue = 156

local Gold = 2 -- Rarity
local GoldSellValue = 322

local GenerationVectors -- Dirt,Stone,Coal,Copper etc
local Coal2 = Instance.new("Part",workspace)
Coal2.Size = Vector3.new(4,4,4)
Coal2.Position = Vector3.new(math.random(#DirtLayer)) --I'm thinking it'd be somewhat like this.