Most projects I've seen try to sync the "players online" with project starts and users moving their mouse to the stop. As projects do not run code when stopped this might seem like the best way to reduce the online variable but users can Alt+f4 or Ctrl+W and avoid the reduction, causing glitches. This project uses an increment variable that every user updates constantly, by measuring the increase with a given delay assuming no-one laggs beyond a few seconds it should always remain accurate.
Update: WHY SCRATCH TEAM WHY? I change Increment by 1 and it drops! WHY????? Open extra tabs! See for yourself! Okay so it does take a little while to update but I wanted to avoid connection lag related glitches Glitches occasionally from connection based lag but this is minimal.