max = 50
amount = 0


while wait do
x = math.random(288,380)
y = 20.5
z = math.random(-387,-277)
	if amount ~= max then
		local part = Instance.new("Part")
		part.Parent = script.Parent
                part.Name = "Iron"
		part.Anchored = true
		part.Position = Vector3.new(x,y,z)
		amount = amount + 1
		wait(10)
    if amount == max then
		script.Parent.Iron:remove()
		amount = amount - 1
		wait(10)
		end
	end
end