Skip to content

how can I get name of function params #803

Answered by vegorov-rbx
vgvgvvv asked this question in Q&A
Discussion options

You must be logged in to vote

When building Luau bytecode, don't forget to set debugLevel to 2 in compilation options.

This will store the required debug information that can then be found in locvars array of a Lua function Proto object.
That array contains the function arguments at the start followed by all the other locals.

You can then use the same methods you use in Lua like lua_getinfo for argument count and lua_getlocal for names and values (placed on top of the stack!)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vgvgvvv
Comment options

Answer selected by vgvgvvv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants