Question about "export" and colons in variables and arguments

what does a colon do in a variable or argument ive seen someone use it and wondered what it does

its something like this

local variable : something = value

and also ive seen someone use “export” in a script and i cant find any information about what it does so could someone explain to me how it works

When you see something like how you’ve shown, it’s basically declaring a variable as a certain type, example

local result : number = 10

This will say that the variable result is a variable for numbers. It’s mostly used for type checking when you have the script that has --!strict as the first line in the script, so the script wont complain at you about type errors

As for export, I’m not sure what are you talking about, could it have been a variable in the script?

3 Likes
export type variable

export then afterwards a variable

The only place I’ve found something related to what you said was here, the Github page for luau. It’s at the very bottom, may that answers your question about exports?

1 Like