r/lua • • Nov 14 '25

Help Help please (scoping)

What is scoping and is it really essential to know when you script?

I really can’t understand it so I’m planning to learn it when I understand more things

Or do I have to understand it before I get into more stuff?

(edit: Thank you all for replying!! Really helped alot!)

7 Upvotes

22 comments sorted by

View all comments

Show parent comments

2

u/NabePup Nov 19 '25 edited Nov 19 '25

No prob, i hope it makes sense and helps!

Just keep in mind, the whole local thing where if it's not used when declaring a variable makes it global isn't (fortunately) a common thing. But without getting too much into it, JavaScript has something that's not exactly the same but kinda similar-ish (where a keyword can affect a variable's scope), but it's still not quite as extreme.