ROBLOX How To's: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
→Global Functions
>Blocco (grammar fix) |
>Emess |
||
Line 73: | Line 73: | ||
===Global Functions=== | ===Global Functions=== | ||
Have you ever wondered how | Have you ever wondered how functions like wait() always work, even though you've never indexed them? | ||
You can, with _G. | |||
_G | Script 1: | ||
<pre>_G.Player = game.Workspace.Player</pre> | |||
Script 2: | |||
<pre>_G.Player:remove()</pre> | |||
If you | If you are familiar with pure Lua, you should notice that we have to index _G before the variable name. Scripts will error without it, because of security vulnerabilities. | ||
You can used shared instead of _G, if you want. | |||
===Custom Objects=== | ===Custom Objects=== |