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

# getcustomasset

> 将已存在的 regular workspace file 复制到 ExtraContent/<hwid>/，并为复制后的 asset path 返回 rbxasset:// string。

<div className="real-function-page">
  ```lua theme={null}
  getcustomasset(path: string): string
  ```

  ## 别名

  * `getsynasset`

  ## 参数

  <ParamField path={"path"} type={"string"} required>
    经过 separator normalization 和 workspace-boundary checks 后在 workspace 内解析的 path。目标必须存在并且是 regular file；不接受 folders、invalid filenames、DOS device names 和 blocked extensions。
  </ParamField>

  ## 返回值

  <ResponseField name={"assetId"} type={"string"}>
    格式为 rbxasset://\<hwid>/\<workspace-relative-path> 的 String，relative path 使用 forward slashes。
  </ResponseField>

  ## 示例

  将已存在的 workspace file 复制到 asset folder，并打印返回的 rbxasset path。

  ```lua theme={null}
  local path = "assets/example.txt"
  writefile(path, "asset bytes")

  local assetId = getcustomasset(path)
  print(assetId)
  print(getsynasset(path))
  ```
</div>
