Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What does "local" mean?

Usually in most scripts I see the word "local" at the start highlighted in dark blue, I would like to know the meaning of it.

1 answer

✓ Accepted answer

I'm taking a risk at my reputation by answering this but:

Local can be used to hold variables, tables, parents, etc. LOCALLY inside of a certain function or piece of code. Here's an example of how the function would be:

function Pie()
local variable = 2
print(variable)
end

function Cake()
local variable = 1
print(variable)
end

The Pie function will print 2 and the Cake function will print 1 instead of Cake printing out 2.

This discussion is preserved as it was. New answers, comments, and votes are closed.