Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to preload a decal asset?

My current code is not working as it is supposed to, its purpose is fairly self-explanatory if you look at the code.

local ContentProvider = game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=144904058")

function WaitForLoad()
	repeat
		wait(1.5)
	until (ContentProvider.RequestQueueSize == 0)
	script.Parent.Text = "Access Mainframe"
end

1 answer

✓ Accepted answer

It seems as if your only problem is that you did not call the function. In order for the function to run you will need to call it like so:

local ContentProvider = game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=144904058")

function WaitForLoad()
    repeat
        wait(1.5)
    until (ContentProvider.RequestQueueSize == 0)
    script.Parent.Text = "Access Mainframe"
end

WaitForLoad() -- this calls the function when the script begins

This discussion is preserved as it was. New answers, comments, and votes are closed.