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

Preload method any other efficient way to do this?

Asked by
CHATED 10
10 years ago

Here is my current script for the loading gui to be added to the players player gui.

game.Players.PlayerAdded:connect(function(Player)
repeat wait() until game.ContentProvider.RequestQueueSize ~= 0
local MainMenu = game.ServerStorage.MainMenu 
local Clone = MainMenu:Clone()
Clone.Parent = Player:WaitForChild("PlayerGui")
end)

And since I have a lot of image labels I need them to be preloaded without buffering in the beginning. So I used this method but it still doesn't work well.

local ContentProvider = Game:GetService("ContentProvider")

local function LoadAssets(AssetList)
    -- Takes an asset list and preloads it. Will not wait for them to load. 

    for _, AssetId in pairs(AssetList) do
        ContentProvider:Preload("http://www.roblox.com/asset/?id=" .. AssetId)
    end
end

LoadAssets({2253543, 2434541, 5133543, 2423433, 41143243, 2453865, 21433365, 2154549})

Any help? Very appreciated

0
What's the problem? At least give us that TurboFusion 1821 — 10y
0
He's trying to preload images before they appear in his loading gui, but they don't show up, even though he's preloaded them. I have problems with preloading images sometimes, where my game just ignores the preload requests and shows blank spaces, making my intro GUI look incomplete. Spongocardo 1991 — 10y

Answer this question