Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to preload a decal asset?

Asked by 9 years ago

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

Log in to vote
2
Answered by 9 years ago

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
Ad

Answer this question