I am using a simple script for doors/light switches that works by having a script in every single on of the interactable parts in the workspace like the physical door or lightswitch. A friend who is a scripter recommended that I don't do this because it will saturate server memory and cause lag. Is this true? If the code is only being triggered by a clickdetector and onMouseClick wouldn't it only draw resources as needed when called to do so?
My final question is, how secure is my practice? Light switches/doors seem non-consequential to me in terms of a exploiter taking advantage of them because I don't see any advantage of them tampering with these sole scripts in the workspace.
Thanks.

5 comments
How many scripts are there?
the scripts are located in each individual door/light switch, I estimate there may be 1,000 doors with a script inside each one and 2,000 lightswitches the same way. It shouldn't be a problem if they're not all active and rely on player input.
Have you tried testing it in-game and see how much lag there is?
in-game in a work-in-progress map with 10 people there is no lag what so ever, my concerned friend is worried about the long term effects of my current practice but I don't currently see no lag at all in this current small scale.
While it may not create lag because of the scripts purpose, you definitely don't need a script for every part and should convert it to one script. It's not always just about lag but efficiency and scalability. Imagine having to edit 2k scripts vs 1.