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

PreloadAsync does not work for ServerStorage and the assets stored in it?

Asked by 3 years ago

I have 2 decals stored in ServerStorage temporally for later use in the game. The assets, when moved to workspace take some time to load, this causes there to be a short but noticeable gap between the moving and loading, when I try to preload assets, it throws an error.

I used PreloadAsync to preload them as shown below but it throws an error every time I try.

game:GetService("ContentProvider"):PreloadAsync(5242825907, 5242817868)

I tried changing the ID's to the actual strings under "Texture" in the Decals, preloading the entire model the decals are attached to, but it keeps on throwing errors, I'm lost on how to preload them in ServerStorage, is there a way to do it or do I have to keep them in the workspace to preload them?

1 answer

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
3 years ago

ContentProvider:PreloadAsync takes a table as its argument, and you're passing 2 values, you need to make a table with them:

game:GetService("ContentProvider"):PreloadAsync({5242825907, 5242817868})
0
I tried this before, it throws "Unable to cast double to Content" error. Adamiscool2004 4 — 3y
0
Tryed exactally like I posted? you may have written something wrong Leamir 3138 — 3y
0
Exactly like that, not sure what's wrong with it, every article I read about PreloadAsync states to do something like that, but yet none work. Adamiscool2004 4 — 3y
Ad

Answer this question