Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is the proper way to store Models for instancing/spawning later?

I've just started to learn Roblox this week, but I can't find anywhere that talks about the best practices for this. Given a UI with spawnable elements, (in my case towers for a tower defence), where would these be stored? I don't want them present in the workspace as they're not needed in the game until spawned, but I still need to be able to edit them. Would the best be to store them in a place and them retrieve them with an id?

I know this is common practice for experienced developers, so I appreciate your patience. Please also let me know if you need better clarification on what I'm trying to achieve.

2 comments

0

the best way in my opinion is ReplicatedStorage, because it can be replicated by the client and the server and dont use lighting as a storage

0

Thanks @EXpodol1234ALT, Out of curiosity and considering my unfamiliarity, in which cases/what examples would I want to use ServerStorage? I am trying to understand what situations only the Server should perform operations, and if so, how the clients are affected. In my case where I'm spawning a tower and all clients should be updated, I assume I'd use ReplicatedStorage, but when would I use Serve

1 answer

###There are services specifically for this, those being ServerStorage and ReplicatedStorage. If you want the stored objects to be inaccessible by clients, use ServerStorage. If you want client-server access, use ReplicatedStorage. This is where RemoteEvents and RemoteFunctions go, as the server and client need to access them. It is a common practice to use Lighting to store objects, however this is bad practice and is unsupported by ROBLOX.

1 comment

0

Thanks, incapaz, just the information I needed. Now I need to find some good resources for client versus server authority!

This discussion is preserved as it was. New answers, comments, and votes are closed.