1 script or 500 SCRIPTS?

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?

2 Likes

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.

5 Likes

Use 1 script. Or use a Module script.
It is a nightmare to edit 50+ scripts.

4 Likes

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?

1 Like

Just do a script instead of 500 scripts…

If you do a script it’s great but you have to code alot…

1 Like

Make a couple module scripts.

  • One for tweening
  • One for damaging players
  • One for settings spawns

Whatever else you can think of

1 Like

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.

2 Likes

Would you consider CS a good way to organize and make scripts such as kill bricks, falling platforms, so on and so forth?