Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does a large amount of minor scripts in workspace affect server/game performance?

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

0

How many scripts are there?

0

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.

0

Have you tried testing it in-game and see how much lag there is?

0

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.

1

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.

1 answer

✓ Accepted answer

Seems to be good, if it doesn't lag for you right now, it probably won't lag ever. If it does start lagging, you can always come back to the forums.

This discussion is preserved as it was. New answers, comments, and votes are closed.