Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What's the better structure: Scripts in individual parts, or script in server script storage?

Asked by 4 years ago

I'm trying to make multiple "turret-like" objects that periodically create a part, however, I'm not sure the best way to structure this. Right now, I have a single script that manage all the turrets, all on the same thread. I kinda want more freedom on how each individual groups of turret work, so would it be better to give each turret its own script, or create multiple threads within the server script?

2 answers

Log in to vote
1
Answered by 4 years ago

I find it easier to manage code when it is all centralized into ServerScriptService. If you want to have customizable turrets, you could put a module script in each turret that contained settings and have your centralized code read off each module as it executes.

Ad
Log in to vote
1
Answered by 4 years ago

I'd use a script inside a part when I'm doing something to it, and I'd use a script inside ServerScriptStorage if it's things that aren't related to parts. (leaderstats, gameScript, etc.)

Answer this question