2DWorlds Forums
Anyway make global variables? - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: Anyway make global variables? (/showthread.php?tid=5579)



Anyway make global variables? - Glome - 06-09-2011

Like a variable that can be defined in one script but then used in another?

OOPS posted in wrong thread! Could a mod move it for me?


RE: Anyway make global variables? - Qwertygiy - 06-09-2011

1: Sure, I'll move it.

2: I think it's either _G.variable or G_.variable, where "variable" is the variable in question. Just say something like

"_G.noob = workspace.Character"

and then in another script, that has to run a moment afterwards...

"_G.noob.Health = 0"


RE: Anyway make global variables? - toast - 06-11-2011

_G and/or shared


RE: Anyway make global variables? - Glome - 06-11-2011

Alright thanks!