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

# dumpstring

> Возвращает decompressed bytecode string для Roblox script object. dumpstring зарегистрирован на ту же C++ function, что и getscriptbytecode, поэтому его поведение идентично. argument должен быть object. Общий bytecode reader принимает значения ClassName ModuleScript, LocalScript, CoreScript и Script. Для Script RunContext должен быть Client. Если ClassName отсутствует, function вызывает "Invalid Instance". Если ClassName не является поддерживаемой script class, function вызывает "Script expected". Если значение является Script с другим RunContext, function вызывает "Expected a Script with RunContext set to Client". Если embedded bytecode reference недействителен или длина stored bytecode равна 8 bytes или меньше, function возвращает nil. Иначе она распаковывает stored bytecode через DecompressBytecode и возвращает resulting bytes как Luau string. Hash mismatch, too-short compressed data или ZSTD decompression errors возвращаются как error text bytes функцией DecompressBytecode, а не выбрасываются здесь.

<div className="real-function-page">
  ```lua theme={null}
  dumpstring(script: userdata): string | nil
  ```

  ## Аргументы

  <ParamField path={"script"} type={"userdata"} required>
    Script object для чтения. Поддерживаемые значения ClassName: ModuleScript, LocalScript, CoreScript и Script с RunContext Client.
  </ParamField>

  ## Возвраты

  <ResponseField name={"bytecode"} type={"string | nil"}>
    Decompressed bytecode bytes как Luau string, DecompressBytecode error text bytes или nil, если usable embedded bytecode недоступен.
  </ResponseField>

  ## Пример

  Read decompressed bytecode from a supported Roblox script Instance. dumpstring is an alias for getscriptbytecode.

  ```lua theme={null}
  local targetScript

  for _, descendant in ipairs(game:GetDescendants()) do
      if descendant:IsA("LuaSourceContainer") then
          targetScript = descendant
          break
      end
  end

  if targetScript then
      local bytecode = dumpstring(targetScript)
      print(bytecode)
  end
  ```
</div>
