mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
feat(imports/require): custom require for script files
This commit is contained in:
6
init.lua
6
init.lua
@@ -23,7 +23,8 @@ if status ~= true then error(status, 2) end
|
||||
|
||||
local LoadResourceFile = LoadResourceFile
|
||||
local context = IsDuplicityVersion() and 'server' or 'client'
|
||||
local function noop() end
|
||||
|
||||
function noop() end
|
||||
|
||||
local function loadModule(self, module)
|
||||
local dir = ('imports/%s'):format(module)
|
||||
@@ -86,6 +87,9 @@ lib = setmetatable({
|
||||
__call = call,
|
||||
})
|
||||
|
||||
-- Override standard Lua require with our own.
|
||||
require = lib.require
|
||||
|
||||
local intervals = {}
|
||||
--- Dream of a world where this PR gets accepted.
|
||||
---@param callback function | number
|
||||
|
||||
Reference in New Issue
Block a user