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

Content provider intro gui help?

Asked by 6 years ago
Edited 6 years ago

So I have a introgui in the following setup.

ScreenGui
      MainMenu
             main(localscript)
             ImageLabel
             Load(Textlabel)
(I plan to add some deco but i want to settle the content provider issue)

When i play the game,the cloning works fine but the content provider does not,this is my first time using content provider

this is the error:

15:29:42.501 - Unable to cast to Array

What does this error mean?What is wrong with my script?What is cast to array?

local imageid = "rbxassetid://1534265662"
local asset = 1534241882
script.Parent.ImageLabel.Image = imageid
game:GetService("ContentProvider"):PreloadAsync("http://www.roblox.com/asset/?id=" .. asset)


while game:GetService("ContentProvider").RequestQueueSize > 0 do
script.Parent.Load.Text = "Assets Remaining".. game:GetService("ContentProvider").RequestQueueSize  
end

if game:GetService("ContentProvider").RequestQueueSize == 0 then
    script.Parent.Load.Text = "Completed!Preparing Player..."
    script.Parent:TweenPosition(UDim2.new(1,0,0,0),"In","Quad",0.55)
    wait(5)
else
    script.Parent.Load.Text = "Assets Remaining".. game:GetService("ContentProvider").RequestQueueSize 

end

Please help.

1 answer

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
6 years ago

Next time please also say the line this error was. Doing it myself in Studio, it was line 4. PreloadAsync takes a table, not a string. Changing it to a table fixes it. Remember that PreloadAsync yields (or waits) until the assets are loaded instead of continuing the script.

game:GetService("ContentProvider"):PreloadAsync({ "http://www.roblox.com/asset/?id=" .. asset })
0
oh ok ill try KawaiiX_Jimin 54 — 6y
0
it works perfectly now,thanks so much! KawaiiX_Jimin 54 — 6y
Ad

Answer this question