I’m making a couple of obby levels and was wondering if I should do like 50 scripts that do the exact same thing or instead just 1 big one that repeats the script for every single part?
Use CollectionService
for grouping parts and just loop over them in one script. Good rule of thumb, try not to repeat code.
In an obstacle course with many bricks that kill players, don’t paste the same script in all your kill bricks! Instead, tag them with “KIllBrick”. Then, have any brick tagged as such kill the player.
Use 1 script. Or use a Module script.
It is a nightmare to edit 50+ scripts.
Let’s say you find out a better way to make killbricks than with .Touched. Would you rather edit 50 scripts to do the same or 1?
Just do a script instead of 500 scripts…
If you do a script it’s great but you have to code alot…
Make a couple module scripts.
- One for tweening
- One for damaging players
- One for settings spawns
Whatever else you can think of
Ideally one script however nobody who plays obbys will notice any performance decrease from extreme unoptimisations as lots of obbys are extremely poorly made to start with, it’s just a case of everyone being used to it at this point.
Would you consider CS a good way to organize and make scripts such as kill bricks, falling platforms, so on and so forth?