AssetUpload

One upload, followed to the end: watch it go from Uploading to Done, then put its ContentId straight into a property.

AssetService:UploadAssetAsync returns it once Roblox has the file; from then on it polls Open Cloud by itself and stays a child of AssetService until the upload ends. WaitAsync gives the ContentId, while StatusChanged and Completed tell you as it happens. An asset still in moderation review counts as Done, a rejected one as Failed, and with a Record file an unchanged file is Skipped instead of sent again.

ShotInstancenot creatableRoblox

Call AssetService:UploadAssetAsync or UploadVersionAsync.

Properties

NameTypeDefaultDescription
AssetType"Image" | "Decal" | "Audio" | "Model""Image"
read-only
Image, Decal, Audio or Model: what the upload makes; a version upload takes it from the file's ending.
Status"Uploading" | "Processing" | "Done" | "Failed" | "Skipped""Uploading"
read-only
Uploading, Processing, then Done or Failed, or Skipped when the Record shows this file already went up; moderation review counts as Done.
OperationIdstring?read-onlyThe Open Cloud operation Roblox gave this upload, which it polls until the asset is ready.
AssetIdnumber?read-onlyThe id of the asset Open Cloud made, or the existing asset's for a version upload or a skipped one.
ContentIdstring?read-onlyWhat goes in a property: rbxassetid://<AssetId> for an Image, Decal or sound; for a Model, its one MeshPart's mesh, else nil.
ModerationState("Reviewing" | "Approved" | "Rejected")?read-onlyReviewing, Approved or Rejected, as Roblox last said; RefreshModerationAsync asks again, and Rejected makes the upload Failed.
Errorstring?read-onlyRoblox's own message when the upload failed, or why ContentId is missing.

Methods

NameArgumentsReturnsDescription
WaitAsync
yields
(timeout: number?)(string?, string?)Waits for the end, 300 s by default: ContentId, or nil and why; a timeout leaves the upload running.
RefreshModerationAsync
yields
()(string?, string?)Waits for Roblox's moderation state as it is now, gives it and stores it in ModerationState.

Events

NamePassesDescription
StatusChanged(string)Fires with the new Status each time it moves on, such as Processing and then Done.
Completed(string)Fires when the upload ends, with its final Status, such as Done or Failed.
From ShotInstance 33