Blocks= {"Emerald","Ruby","Sapphire","Diamond","Coal","Coal","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Di rt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt","Dirt"}
function Mako()
for _, Part in pairs(script.Parent:GetChildren()) do
if script.Parent.Parent.Generate.BrickColor ~= "Really red" then
local Rocky = game.Lighting:FindFirstChild(Blocks[math.random(1,#Blocks)])
local Mine = Rocky:Clone()
Mine.Position = script.Parent.Part.Position
Mine.Parent = script.Parent.Parent.Field
else
print("Cooling Down, Please wait")
end
end
end
script.Parent.Parent.Generate.ClickDetector.MouseClick:connect(Mako)
this script is supposed to do this function to all parts named part in script.Parent instead it just takes a bunch of clones from lighting and puts them into the position of one brick
no errors cuz the if statement

5 comments
Ok, generate is a button that resets the mine, Mine's parent is Field, and the parts the script is cycling through are in a group called MineArea
May I get a full Hierarchy list of your build? I need to know if field is also copied 600 times just like the button, or if Field is just an instance in Workspace you can get to by doing game.Workspace.Field- then I can help.
I will try to explain. So im supposed to have the script in MineArea, which contains all the parts(the parts are called "Part") wich give the generated blocks a position, field is the model wich parents the generated blocks. Generator is a button that you click to Activate the Mine Being generated.
Oh, and Field is game.Workspace["Mining Tycoon"].Tycoons.Diamond.Essentials.Mineing.Field
I will place my script that i edited into my question body