Learn
Engine Class
ContentProvider
Not Creatable
Service
Not Replicated

Summary
Methods
Preload(contentId: ContentId):()
Deprecated
PreloadAsync(contentIdList: {any},callbackFunction: function):()
RegisterEncryptedAsset(assetId: ContentId,encryptionKey: string):()
RegisterSessionEncryptedAsset(contentId: ContentId,sessionKey: string):()
UnregisterEncryptedAsset(assetId: ContentId):()
Events
AssetFetchFailed(assetId: ContentId):RBXScriptSignal
Inherited Members
Code Samples
ContentProvider
local ContentProvider = game:GetService("ContentProvider")
local LOGO_ID = "rbxassetid://658743164"
local PAGE_TURN_ID = "rbxassetid://12222076"
local decal = Instance.new("Decal")
decal.ColorMapContent = Content.fromUri(LOGO_ID)
local sound = Instance.new("Sound")
sound.SoundId = PAGE_TURN_ID
local assets = { decal, sound }
ContentProvider:PreloadAsync(assets)
print("All assets loaded.")

API Reference
Properties
BaseUrl
Read Only
Not Replicated
Read Parallel
Capabilities: AssetManagement
ContentProvider.BaseUrl:string

RequestQueueSize
Read Only
Not Replicated
Read Parallel
Capabilities: AssetManagement
ContentProvider.RequestQueueSize:number
Code Samples
ContentProvider Loading Bar
local ContentProvider = game:GetService("ContentProvider")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui
-- create a basic loading bar
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.5, 0, 0.1, 0)
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
frame.AnchorPoint = Vector2.new(0.5, 0.5)
frame.Parent = screenGui
local bar = Instance.new("Frame")
bar.Size = UDim2.new(0, 0, 1, 0)
bar.Position = UDim2.new(0, 0, 0, 0)
bar.BackgroundColor3 = Color3.new(0, 0, 1)
bar.Parent = frame
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
local sound2 = Instance.new("Sound")
sound2.SoundId = "rbxassetid://9120385974"
local assets = {
sound,
sound2,
}
task.wait(3)
for i = 1, #assets do
local asset = assets[i]
ContentProvider:PreloadAsync({ asset }) -- 1 at a time, yields
local progress = i / #assets
bar.Size = UDim2.new(progress, 0, 1, 0)
end
print("loading done")

Methods
GetAssetFetchStatus
Capabilities: AssetManagement
ContentProvider:GetAssetFetchStatus(contentId:ContentId):Enum.AssetFetchStatus
Parameters
contentId:ContentId
Code Samples
Monitoring AssetFetchStatus
local ContentProvider = game:GetService("ContentProvider")
-- An example asset to load
local ASSET_ID = "rbxassetid://9120386436"
local exampleAsset = Instance.new("Sound")
exampleAsset.SoundId = ASSET_ID
-- Output the current AssetFetchStatus of the asset
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(ASSET_ID)
print("Initial AssetFetchStatus:", initialAssetFetchStatus)
-- Listen for updates
local assetFetchStatusChangedSignal = ContentProvider:GetAssetFetchStatusChangedSignal(ASSET_ID)
local function onAssetFetchStatusChanged(newAssetFetchStatus: Enum.AssetFetchStatus)
print(`New AssetFetchStatus: {newAssetFetchStatus}`)
end
assetFetchStatusChangedSignal:Connect(onAssetFetchStatusChanged)
-- Trigger the asset to preload
local function onAssetRequestComplete(contentId: string, assetFetchStatus: Enum.AssetFetchStatus)
print(`Preload status {contentId}: {assetFetchStatus.Name}`)
end
ContentProvider:PreloadAsync({ exampleAsset }, onAssetRequestComplete)

GetAssetFetchStatusChangedSignal
Capabilities: AssetManagement
ContentProvider:GetAssetFetchStatusChangedSignal(contentId:ContentId):RBXScriptSignal
Parameters
contentId:ContentId
Code Samples
Monitoring AssetFetchStatus
local ContentProvider = game:GetService("ContentProvider")
-- An example asset to load
local ASSET_ID = "rbxassetid://9120386436"
local exampleAsset = Instance.new("Sound")
exampleAsset.SoundId = ASSET_ID
-- Output the current AssetFetchStatus of the asset
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(ASSET_ID)
print("Initial AssetFetchStatus:", initialAssetFetchStatus)
-- Listen for updates
local assetFetchStatusChangedSignal = ContentProvider:GetAssetFetchStatusChangedSignal(ASSET_ID)
local function onAssetFetchStatusChanged(newAssetFetchStatus: Enum.AssetFetchStatus)
print(`New AssetFetchStatus: {newAssetFetchStatus}`)
end
assetFetchStatusChangedSignal:Connect(onAssetFetchStatusChanged)
-- Trigger the asset to preload
local function onAssetRequestComplete(contentId: string, assetFetchStatus: Enum.AssetFetchStatus)
print(`Preload status {contentId}: {assetFetchStatus.Name}`)
end
ContentProvider:PreloadAsync({ exampleAsset }, onAssetRequestComplete)

ListEncryptedAssets
Capabilities: AssetManagement
ContentProvider:ListEncryptedAssets():{any}
Returns

Preload
Deprecated

PreloadAsync
Yields
Capabilities: AssetManagement
ContentProvider:PreloadAsync(
contentIdList:{any}, callbackFunction:function
):()
Parameters
contentIdList:{any}
callbackFunction:function
Default Value: "nil"
Returns
()
Code Samples
Preloading Assets
local ContentProvider = game:GetService("ContentProvider")
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
local decal = Instance.new("Decal")
decal.ColorMapContent = Content.fromUri("rbxassetid://5447528495")
local assets = {
decal,
sound,
}
-- This will be hit as each asset resolves
local callback = function(assetId, assetFetchStatus)
print("PreloadAsync() resolved asset ID:", assetId)
print("PreloadAsync() final AssetFetchStatus:", assetFetchStatus)
end
-- Preload the content and time it
local startTime = os.clock()
ContentProvider:PreloadAsync(assets, callback)
local deltaTime = os.clock() - startTime
print(("Preloading complete, took %.2f seconds"):format(deltaTime))

RegisterDefaultEncryptionKey
Capabilities: AssetManagement
ContentProvider:RegisterDefaultEncryptionKey(encryptionKey:string):()
Parameters
encryptionKey:string
Returns
()

RegisterDefaultSessionKey
Capabilities: AssetManagement
ContentProvider:RegisterDefaultSessionKey(sessionKey:string):()
Parameters
sessionKey:string
Returns
()

RegisterEncryptedAsset
Capabilities: AssetManagement
ContentProvider:RegisterEncryptedAsset(
assetId:ContentId, encryptionKey:string
):()
Parameters
assetId:ContentId
encryptionKey:string
Returns
()

RegisterSessionEncryptedAsset
Capabilities: AssetManagement
ContentProvider:RegisterSessionEncryptedAsset(
contentId:ContentId, sessionKey:string
):()
Parameters
contentId:ContentId
sessionKey:string
Returns
()

UnregisterDefaultEncryptionKey
Capabilities: AssetManagement
ContentProvider:UnregisterDefaultEncryptionKey():()
Returns
()

UnregisterEncryptedAsset
Capabilities: AssetManagement
ContentProvider:UnregisterEncryptedAsset(assetId:ContentId):()
Parameters
assetId:ContentId
Returns
()

Events
AssetFetchFailed
Capabilities: AssetManagement
ContentProvider.AssetFetchFailed(assetId:ContentId):RBXScriptSignal
Parameters
assetId:ContentId

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.