Essentials in a framework? =)

I’ve written some of my thoughts on creating your own “framework” (more like gamemode, honestly) here and here.

TL;DR is:

  • A solid “sandbox” for your scripts. Code in such a way that you won’t need to constantly copy utility functions from one script to the other. Notifications, chat messages, and other general UI can stay in the core, and be used through event / exports by the rest of the server scripts.

  • You’re probably want to make an RP server, which means that you will need to store and use a lot of player data. Having this system rock-solid will remove a lot of headache once the server becomes cluttered with scripts. My advise is to make the player data system in such a way that you won’t need to constantly write/read from the db.

  • Write scripts using the current “coding meta”. Use convars and kvp for settings instead of config.lua files, use state machines and run most of (if not all) logic through the server for verifications.
    If you do this, meme lua executors can’t do sh*t on your server because the server will have the final word in decision-making.

  • Use server-side entities, so you can take advantage of SetRoutingBucketEntityLockdownMode - Natives @ Cfx.re Docs. Also, did I mention that OneSync should always be used? Because it should.

  • Play-test often, and with as many people as you can. It took me many months to realize that many of my scripts were broken, because I didn’t take Entity Ownership into account. Only realized once I made the server public, and most of my scripts broke.

  • Have a very clear plan for your main gamemode. It’s easy to get stuck in the details.

  • Have fun, I guess :slight_smile: . It will take you some good months to finish it, especially if you work alone, so be patient.

  • Use github, or any version control service / software.

7 Likes