Image not changing in script

Image is not changing in the script.

while true do
	
	local video = script.Parent
	
	video.Image = ("https://www.roblox.com/asset/?id=8814856839")
	wait(1)
	video.Image = ("https://www.roblox.com/asset/?id=8814859316")
	wait(1)
	
end

I actually manually changed the [(1) 2 - Roblox](https://www.roblox.com/library/8814856839/2) to https://www.roblox.com/asset/?id=8814856839 I don’t know if that affects something.

Idk why is it not working properly

Video.Image = "rbxassetid://8814856839"

No need 4 the loop.


still shows nothing

wait , I think I should remove the brackets, let me try that

I tried removing the brackets, but it did not work.

What is the Video? ImageLabel?

Yeah, it is image label. Not decal

local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")

function getImageIdFromDecal(decalId)
	local assetInfo = MarketplaceService:GetProductInfo(decalId, Enum.InfoType.Asset)
	
	assert(assetInfo.IsPublicDomain)
	assert(assetInfo.AssetTypeId == Enum.AssetType.Decal.Value)
	
	local decal = InsertService:LoadAsset(decalId):FindFirstChildWhichIsA("Decal")
	return decal.Texture
end
Video.Image = getImageIdFromDecal(8814856839)

I said it is NOT decal.

I said image-Label

But your image is decal, I suggest you try the provided code and update me if it worked.

I replaced my code with yours

and still it does not work

U have to run the function.

Video.Image = getImageIdFromDecal(8814856839)

Where am I supposed to put this in the code?

Just under the function. Also if that doesnt work try this:

Video.Image = string.format("rbxassetid://%s",getImageIdFromDecal(8814856839))

Try both just in case

The code is like this now.

local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")

function getImageIdFromDecal(decalId)
	Video.Image = getImageIdFromDecal(8814856839)
	local assetInfo = MarketplaceService:GetProductInfo(decalId, Enum.InfoType.Asset)

	assert(assetInfo.IsPublicDomain)
	assert(assetInfo.AssetTypeId == Enum.AssetType.Decal.Value)

	local decal = InsertService:LoadAsset(decalId):FindFirstChildWhichIsA("Decal")
	return decal.Texture
end

Was I supposed to remove my old code?

local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")

function getImageIdFromDecal(decalId)
	Video.Image = getImageIdFromDecal(8814856839)
	local assetInfo = MarketplaceService:GetProductInfo(decalId, Enum.InfoType.Asset)

	assert(assetInfo.IsPublicDomain)
	assert(assetInfo.AssetTypeId == Enum.AssetType.Decal.Value)

	local decal = InsertService:LoadAsset(decalId):FindFirstChildWhichIsA("Decal")
	return decal.Texture
end

Video.Image = getImageIdFromDecal(8814856839)
local InsertService = game:GetService("InsertService")
local MarketplaceService = game:GetService("MarketplaceService")
local Video = script.Parent

function getImageIdFromDecal(decalId)
	Video.Image = getImageIdFromDecal(8814856839)
	local assetInfo = MarketplaceService:GetProductInfo(decalId, Enum.InfoType.Asset)

	assert(assetInfo.IsPublicDomain)
	assert(assetInfo.AssetTypeId == Enum.AssetType.Decal.Value)

	local decal = InsertService:LoadAsset(decalId):FindFirstChildWhichIsA("Decal")
	return decal.Texture
end

Video.Image = getImageIdFromDecal(8814856839)

Code is like this now, but I don’t see anything happening when I start the game.

This works: (no need for complicated functions)

--//Variables
local Video = script.Parent

--//Loops
while true do
	Video.Image = "rbxassetid://8814856822"
	task.wait(1)
	
	Video.Image = "rbxassetid://8814859302"
	task.wait(1)
end
1 Like