Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What are _G and _VERSION, what they are used for and how to use them?

Asked by 4 years ago

I have noticed when I use for _, these _G and _VERSION were popping out. Can someone please explain what those are, what they are for and how to use them?

1 answer

Log in to vote
5
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

_G are global variables mostly used in module scripts you might have seen it in games/plugin Basically _G is a table that you can assign things such as keys and values _G saves scripts like cross - scripts

You can access variables from different server side scripts. If you have this in one script

_G.player = "player"

print(_G.player)

OUTPUT: Player

If my answer helped make sure to accept.

Meanwhile _Version is A global variable (not a function) that holds a string containing the current interpreter version.

To learn more click here

0
Thx. DangerousKillerTimur 54 — 4y
0
server-side not server side JesseSong 3916 — 3y
Ad

Answer this question