detecting when recoding a video or demo

i have made some lua scripts that make it easier to make videos by telling/showing the players what i want them to do. but the problem is that this information is also showing up in recorded demos and such. so is there a way to have my script detect when the demo is being played back and not run?

You could make a console command that blocks the information for the client who uses it.
So you could disable it for yourself when you’re about to record.

I do not think that there is a way for Lua to check if you are recording.

while that is a possible option, it also kind of defeats the purpose of having it. the lua code i believe is reran when the demo is played back, so in theory its possible and from what i’ve found so far it looks like there might be a way, i just haven’t found that way yet.

although i guess i could create a convar and manually change the value of it when the demo playback starts, but i’m lazy and would prefer a more automatic approach to the problem.