[DISCONTINUED] PreloadService - Customizable way to load assets via ContentProvider [v2]

Hi, this module looks extremely interesting. I have a quick question though, would this theoretically be possible to load assets on demand? For example, when someone opens a shop menu it just “knows” and automatically loads those assets, and unloads assets that won’t be needed? I know it’s possible, just very hard but thought this could be something this module could do extremely well.

1 Like

Yes, it is!

button.MouseButton1Click:Connect(function()
	require(game.ReplicatedStorage.PreloadService).Load(script.Parent:GetDecendants(), "None", nil
	require(game.ReplicatedStorage.PreloadService.Completed.OnClientEvent:Connect(function() --In the future, I plan on adding "codes" to it to make it so it only fires when you're loading the menu, but for now this will have to do. If you dont want it that way, just delete the event here.
		script.Parent.Visible = true
	end)
end)

I did reread your request, and it sounds like it could be an actual feature! I might add it, if I do I will add a credit for you in the Info menu

1 Like

That’s super cool, thanks for sharing.

PS: Are there any updates on server sided loading? Think that would also help speed-up things. Side note, got a Discord where we can chat?

1 Like


It’s coming with the Admin Panel, which will be coming soon. I still need to get some code and UI finished.

My discord is Pixlz#4627 if you wanna chat :smile:

1 Like


If I had to guess, only a few more days before 2.0! Thank you all so much for all of the support. It really does mean a lot to me. Expect 2.0 very soon!


Please note that Player Management will not work in studio!

I also decided to make a PS Discord Server!

For if you don’t have DevForum member, and have a feature request or bug.

1 Like

When 2.0 comes out, I will rewrite the topic again.
About 2 frames left, and a lot of code!
In the meantime, I made this.
PreloadService Theme Sharing Thread - Bulletin Board - DevForum | Roblox

Hey all!

Glad to say that I’m on track for a release tonight!
Making last minute improvements and fixes, stay tuned!


New topbar

UPDATE: y pc just took a small update for 20 mins straight… may be delayed.

1 Like

2.0! FINALLY!

Yep, I updated the module!

Please reread the topic if you have the time, there’s some pretty big changes.

If you have a new bug, feature request, or issue, feel free to reply! :smile:

Note: If it says [Disabled] in the Admin Panel section, then it’s intentionally broken as the code isn’t finished.
Thanks everybody for the 1 month wait!

Also, the beta [PS Blue] is moving to request only for the time being. Thank you for undertsanding

I got this error. How do I fix this?

image

1 Like

Did you move the module directly into the folder, taking it out of the ServerScript?

The module is on the Serverscript.

1 Like

So, my fix;

Delete the code you have
Get it again from the library
Put the script that comes out of it in ServerScriptService
Replace like 11 of the ServerScript with this
moduleNotRequire.Parent = game.ReplicatedStorage.Modules --because that's the location specified in the error

I still get the error

1 Like

Can I see the code that you’re firing the module from? I cant reproduce it, trying to reproduce it from “Game” now

Here is my code

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local PreloadService = require(ReplicatedStorage.Assets.Modules:WaitForChild("PreloadService"))


PreloadService.Load("Game", "Default", nil)

PreloadService.Completed.OnClientEvent:Connect(function(Time)
	print("The game loaded in "..Time.." seconds!")
end)
1 Like

I was able to reproduce it.

Give me 5ish minutes. Thanks for reporting!

1 Like

Ok, so it’s being really weird, I cant repo it in my main testing game, but the issue wont go away in a baseplate. Give me a bit more time to track it down.

1 Like

Sorry for the wait, I found the issue, and patched it :wink:

1 Like

Thank you, the problem is fixed now.

1 Like

Hey all!

While working on v2.1, I decided to do a mass loading test, and it’s a success!

image

Now, you can say that the test results show that it’s safe to use for large games!!

2.1 coming soon!