Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's the real difference between local and global variables?

All I know is local variables are faster by a bit. But what's the overall difference, and should I use one over the other. What I do is use local but i don't know if I should keep doing it.

1 comment

2

The difference between these two can be found all over the Internet, I don't need to post one. Roblox Wiki has one: https://www.robloxdev.com/articles/Scope

1 answer

Local variables only apply in the function or loops or if statements while Global variables are for interacting with the entire script

This discussion is preserved as it was. New answers, comments, and votes are closed.