Hey everyone, currently I’m working on a project that is trying to make a better functions (don’t ask why lol). Basically the issue I am having is that when I use the function, I can’t do the extension. You know how they have :Fire() or .Load at the end of their require.
local lib = {}
function lib.require(id)
require(id) -- how do i do the thingy at the end? .load("abayneh12")
end
function require2(target: number | Instance): any
if type(target) == "number" then
local InsertService = game:GetService("InsertService")
target = InsertService:LoadAsset(target):GetChildren()[1]
elseif typeof(target) ~= "Instance" then
error("Attempted to call require with invalid argument(s).")
end
return require(target)
end