What's the difference when using "do"?
First code:
local words = "i failed in math class"
print(words)
Second code:
local words = "i failed in math class"
do
print(words)
end
If it's useful, then how do I make it useful?
What's the difference when using "do"?
First code:
local words = "i failed in math class"
print(words)
Second code:
local words = "i failed in math class"
do
print(words)
end
If it's useful, then how do I make it useful?
I suggest the first code shown. That saves time leaving more for actual development. Now if the code was
local words = game.Workspace.String.Value
do
print(words)
end
then I suggest the second method.
If this helped don't hesitate to mark it as an answer.
Thanks <3
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
What is this post?
i agree
shouldn't it be obvious? other than the words printed
There is no difference. Only that the latter is in a different scope.
do .. endcreates a new empty scope.ok