> ## 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

> Returns a new table containing the current LUA_GLOBALSINDEX values for _G and shared. The function takes no arguments, creates a fresh table, assigns _G from LUA_GLOBALSINDEX._G and shared from LUA_GLOBALSINDEX.shared, and returns exactly one value. It does not return the full global table, and no alias is registered for getscriptglobals.

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

  ## Returns

  <ResponseField name={"globals"} type={"table"}>
    Fresh table with \_G and shared fields copied from LUA\_GLOBALSINDEX.
  </ResponseField>

  ## Example

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

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

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