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 overridesserver.lua- For server-side functions and overridesshared.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'
endServer-side patch (5s_lib/resource/patches/server.lua):
fs.framework.getPlayer = function(source)
return myFunctionToGetAPlayer(source)
endShared patch (5s_lib/resource/patches/shared.lua):
fs.utils.logInfo = function(...)
print('my cool log: ', ...)
endLast updated