For example,
getconstants only works on Luau closures:
Parameters
Returns
true if func is a Luau closure, false if it’s a C closure.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
islclosure(func: function): boolean
getconstants only works on Luau closures:
for _, fn in ipairs(getgc()) do
if type(fn) == "function" then
if islclosure(fn) then
-- it's a LocalScript's/ModuleScript's Luau function!
for i, k in ipairs(getconstants(fn)) do
print(`constant {i}: {tostring(k)}`)
end
else
-- it's an internal roblox's engine C function, pass
end
end
end
| Parameter | Type | Description |
|---|---|---|
func | function | The function to check. |
true if func is a Luau closure, false if it’s a C closure.
local isL = islclosure(print)
local luaclosure = newlclosure(function()
return "new"
end)
local luaclosure2 = function()
return "also new"
end
local cclosure = newcclosure(function()
return "old ahh"
end)
print(islclosure(luaclosure)) -- true
print(islclosure(luaclosure2)) -- true
print(islclosure(cclosure)) -- false