Global Functions

From Goodblox Wiki
Jump to navigationJump to search


Have you ever wondered how things like :Remove() and :Clone() always work, even though you've never indexed it? Here's how.

How a global command works

If you know how to use the _G[] (global) command, this might come more easily to you than others. This is basically how a global command works:

_G["Bob"] = game.Workspace.Bob

If you're in a ScriptBuilder, you can exit that script and open a new one. Put this in it:


run that script, and Bob's torso gets removed! Why? Because the _G[] (global) command makes "Bob" available in every script.

Getting a global function

_G["Lazer"] = function(person) 

Now exit that script, and run this script:


If your character's name is "Bob," you should have your torso removed.