> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getscriptglobals

> 返回包含 _G 和 shared 的 current LUA_GLOBALSINDEX values 的 new table。该 function 不接受 arguments，会创建 fresh table，把 _G 从 LUA_GLOBALSINDEX._G 赋值，把 shared 从 LUA_GLOBALSINDEX.shared 赋值，并返回 exactly one value。它不会返回 full global table，getscriptglobals 没有注册 alias。

<div className="real-function-page">
  ```lua theme={null}
  getscriptglobals(): table
  ```

  ## 返回值

  <ResponseField name={"globals"} type={"table"}>
    从 LUA\_GLOBALSINDEX 复制了 \_G 和 shared fields 的 fresh table。
  </ResponseField>

  ## 示例

  Read the \_G and shared values copied from LUA\_GLOBALSINDEX.

  ```lua theme={null}
  local globals = getscriptglobals()

  print(globals._G)
  print(globals.shared)
  ```
</div>
