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.

Syntax
Luau
getcustomasset(path: string) -> string

Parameters

Function parameters
ParameterTypeDescription
pathstringWorkspace-relative path of the existing asset file.

Returns

string

An 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

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
Kawaii documentation