Hello Guys
For My Entire Scripting Journey I Never Noticed A Diffrence Between A Local Function And A Global Function
Can Somebody Explain it?
Hello Guys
For My Entire Scripting Journey I Never Noticed A Diffrence Between A Local Function And A Global Function
Can Somebody Explain it?
So if you have a local function, then the function can only be called in the code block that it was created in, and inferiors, while globals can be called anywhere
If Iām bad at explaining, check this out.
thanks i really appreciate that
In addition to the above, when you not use local
you are technically overwriting a variable, this:
Something = function()
print("Something")
end
is equal to this:
function Something()
print("Something")
end
You can also check this
local function Example()
print("Something 1")
end
print(Example) --> function: 0x8cfb13e15b91d402
function Example()
print("Something 2")
end
print(Example) --> function: 0x0be947a3943cca82
and that roblox typecheck gives a warn
intresting how it can print something way diffrent and overwrites it.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.