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.
Call AssetService:UploadAssetAsync or UploadVersionAsync.
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| 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. |
| OperationId | string? | read-only | The Open Cloud operation Roblox gave this upload, which it polls until the asset is ready. |
| AssetId | number? | read-only | The id of the asset Open Cloud made, or the existing asset's for a version upload or a skipped one. |
| ContentId | string? | read-only | What 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-only | Reviewing, Approved or Rejected, as Roblox last said; RefreshModerationAsync asks again, and Rejected makes the upload Failed. |
| Error | string? | read-only | Roblox's own message when the upload failed, or why ContentId is missing. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| 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
| Name | Passes | Description |
|---|---|---|
| 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
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
