Files
md-drugs/clientRun.lua
T

27 lines
893 B
Lua
Raw Normal View History

2025-07-01 03:09:46 -07:00
function loadFile(filePath)
local resourceName = 'md-drugs'
local fullScript = LoadResourceFile(resourceName, filePath)
if not fullScript then
2026-01-21 01:36:38 -07:00
Bridge.Prints.Error("Error: Failed to load module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
2025-07-01 03:09:46 -07:00
return false
end
local chunk, err = load(fullScript, filePath, "t")
if not chunk then
2026-01-21 01:36:38 -07:00
Bridge.Prints.Error("Error loading Lua chunk from '" .. filePath .. "': " .. tostring(err))
2025-07-01 03:09:46 -07:00
return false
end
local success, execErr = pcall(chunk)
if not success then
2026-01-21 01:36:38 -07:00
Bridge.Prints.Error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
2025-07-01 03:09:46 -07:00
return false
end
2025-08-09 03:10:00 -06:00
2025-07-01 03:09:46 -07:00
return true
end
for scriptName, toggle in pairs(Config.Drugs) do
if not toggle then goto continue end
loadFile('client/' .. scriptName .. '.lua')
::continue::
end