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

> Dekompiluje Roblox script i zwraca wygenerowany source text, gdy bytecode jest dostępny. argument musi być obsługiwaną script Instance. Jeśli użyteczny bytecode nie jest dostępny, function zwraca nil.

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

  ## Argumenty

  <ParamField path={"script"} type={"userdata"} required>
    Script object do decompile. Obslugiwane wartosci ClassName to ModuleScript, LocalScript, CoreScript i Script z RunContext Client.
  </ParamField>

  ## Zwroty

  <ResponseField name={"source"} type={"string | nil"}>
    Decompiler output string, caught decompiler exception text, albo nil, gdy nie ma usable embedded bytecode.
  </ResponseField>

  ## Przykład

  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>
