I have a script that for every part in a model it puts a random block from lighting into that blocks position, but it just put all the blocks listed in Blocks in the same part, help
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)
no errors, my if statement makes it have none
