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

# decompile

> Roblox script를 decompile하고 bytecode를 사용할 수 있으면 생성된 source text를 반환합니다. argument는 지원되는 script Instance여야 합니다. 사용할 수 있는 bytecode가 없으면 function은 nil을 반환합니다.

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

  ## 인수

  <ParamField path={"script"} type={"userdata"} required>
    decompile할 Script object입니다. 지원되는 ClassName values는 ModuleScript, LocalScript, CoreScript, RunContext Client인 Script입니다.
  </ParamField>

  ## 반환값

  <ResponseField name={"source"} type={"string | nil"}>
    Decompiler output string, caught decompiler exception text, 또는 usable embedded bytecode가 없으면 nil입니다.
  </ResponseField>

  ## 예제

  Decompile a supported Roblox script Instance. To decompile a whole game, iterate its descendants or use a saveinstance workflow.

  ```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 source = decompile(targetScript)

      if source then
          print(source)
      end
  end
  ```
</div>
