getcustomasset Synchronous
getsynasset
Copy a workspace file into Kawaii's local asset store and get a Roblox content URI for it. Set that URI on a Roblox property that accepts image or other asset content.
Luau
getcustomasset(path: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative path of the existing asset file. |
Returns
stringAn rbxasset:// content URI.
Usage notes
The source file must exist. A Drawing Image uses its Data property with file bytes instead of this URI.
Differences from Volt
Volt documents access through explicitly created workspace symlinks. Kawaii rejects symlinks in workspace paths; all workspace operations remain subject to its path containment checks.
Example
Luau
local imagePath = "images/example.png" -- Supply this file first.
local player = game:GetService("Players").LocalPlayer
if isfile(imagePath) and player then
local image = Instance.new("ImageLabel")
image.Image = getcustomasset(imagePath)
image.Size = UDim2.fromOffset(120, 120)
image.Parent = player:WaitForChild("PlayerGui")
task.delay(5, function() image:Destroy() end)
end