Simple way to make a security camera using viewport frames?

Basically what I want is to make a security camera, which’s view will be seen on a surface that has a viewport frame. (sorry if I have poor grammar) I tried a simple method first (forgot the code), and then when I tried a couple more times, I gave up and tried to make it using an AI script generator, which used something like:

ViewportFrame:CapturePixels()

And when I asked it what did it do, then it said that it “takes a screenshot”, or something like that. Then I went to Learn Roblox website thing, nothing of that showed up, not even in the object browser. I found a toolbox model that may do, but I wanted to make my own, and when I opened up the script that made all of it possible, it was a mess. It used such methods that I haven’t even seen and it sorted it all into a some sort of pile that basically is hard to read. How could I make one myself in a simple way?