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

How to globally define something?

Asked by
emite1000 335 Moderation Voter
10 years ago

So there is defining locally, normally, and globally (at least I think that's what it's called).

For locally you put local in front of whatever you are defining. For normal you put nothing. But I can't remember what you do to define something globally (so it can be accessed by any script across the game)

Super easy question because I am forgetful.

0
I think it was _G or something... emite1000 335 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

You use _G. It's not only for variables either, it can be used for many things. For example:

_G["Print"] = function(printThis) print(printThis) end
Ad

Answer this question