Patches

Instead of directly editing 5s_lib files, create your own patches to save time when updating! This approach allows you to maintain your customizations separately from the core library files.

We created three patch files located in 5s_lib/resource/patches that you can use to override or extend functionality:

  • client.lua - For client-side functions and overrides

  • server.lua - For server-side functions and overrides

  • shared.lua - For functions shared between client and server

These patch files are loaded after all fs. variables are set, ensuring your customizations take precedence without causing conflicts.

Examples

Client-side patch (5s_lib/resource/patches/client.lua):

 fs.framework.getFirstName = function()
     return 'dunk'
 end

Server-side patch (5s_lib/resource/patches/server.lua):

 fs.framework.getPlayer = function(source)
     return myFunctionToGetAPlayer(source)
 end

Shared patch (5s_lib/resource/patches/shared.lua):

 fs.utils.logInfo = function(...)
     print('my cool log: ', ...)
 end

Last updated