writecustomasset
Writes a file and returns the asset id for it in one call.
Syntax
writecustomasset(path: string, content: string) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative file to create. |
content | string | The asset's bytes. |
Returns
| Type | Description |
|---|---|
string | An rbxasset:// id for the written file. |
Description
It is writefile followed by getcustomasset on the same path.
Example
local id = writecustomasset("example.txt", "hello")
print(id)
delfile("example.txt")
These are Game executor contracts. Check build requirements and session lifetimes before using them.
