What does "local" mean in lua scripts

Im trying to learn the differce between c++ and lua I’ve noticed that “local” is used alot is in like a function?

local just defines variables locally.

1 Like

okay thank you :+1:

Eg:

if x then
   local y = "string"
end

So y could not be used outside of that if statement.

oh so if you only wanted to just that function on one script you would use local cool. Thanks for the tip

2 Likes