What does 'do' do?

I am analyzing some code. In it is this.

do
	--blah blah blah code...
end

I have never seen this. I am assuming it just does the code inside. Does anybody know what it does?

It creates a new scope.
http://lua-users.org/wiki/ScopeTutorial

local Variable = 1

do
	print(Variable) --Prints 1
	local Variable = 5
	print(Variable) --Prints 5
end

print(Variable) --Prints 1
13 Likes