How to use Lua Annotations (Solved)

I am unsure what to make of this, but I am wondering what it does. I assume it’s for popups in studio but I’ve seen it in some scripts and I’m just really confused on what it means.

Also excuse my selective title, I legit don’t know what they’re called.

RobloxStudioBeta_aKO93OOKi4

What’s axn set to? This is an odd piece of code.

You mean the string: part? That’s a type annotation, which tells the Lua type checker and also programmers who call the function what type the argument called “argument” should have. In this case if someone calls axn.require with parameters other than 1 string, it should underline the function call in red squiggles. E.g. axn.require(Instance.new("Part")) because the type of Parts is not string.

2 Likes

I am replacing the require function with a new one so if you put axn://modulename it’ll pick it from a folder instead of having to do script.Parent.blah

Thanks for the info, I now know what annotations are.