Blocks are in tables and I was wondering how to simplify this code so that I don't have to write it over and over again:
rs = game.ReplicatedStorage
local block = {
rs:WaitForChild("StoneBlock"),
rs:WaitForChild("DimondBlock")
}
local dimondChance = 0.1
local rand = math.random()
if rand < dimondChance then
local clonedblock = block[2]:Clone()
clonedblock.Parent = folder --destination folder
clonedblock:SetPrimaryPartCFrame(CFrame.new(x, y, z))
else
local clonedblock = block[1]:Clone()
clonedblock.Parent = folder --destination folder
clonedblock:SetPrimaryPartCFrame(CFrame.new(x, y, z))
end
Thanks for the Help!

2 comments
just an FYI math.random((1/10), (10/10))
whats that gonna do? if you put no arguments it generates a pseudo number from 0 to 1