📜  roblox 中的 local 是什么意思 - Lua 代码示例

📅  最后修改于: 2022-03-11 14:54:54.993000             🧑  作者: Mango

代码示例1
-- A local variable is accessible only in the block where it’s declared. 
-- Local variables are declared using the local statement:

function add(number)
    local myNumber = 50
      myNumber = myNumber + number -- This will work because is Inside the code Block
end
myNumber = myNumber + 10 -- This wont work because we cannot access it