light flicker

hello, i’m trying to convert this to c++ but i just can’t do it, i’ve tried several ways (because i want to learn c++) i’d appreciate if someone could help me with guidance on how to do it and thank you very much.

This is my .h I was planning to use InitLight and then use it in the editor and connect it to beginplay.

I would leave image of my cpp but it did not work.