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

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

Asked by 5 years ago
Edited 5 years ago

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.

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 User#23365 30 — 5y
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 Firedan1176 29 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

0
Thanks, incapaz, just the information I needed. Now I need to find some good resources for client versus server authority! Firedan1176 29 — 5y
Ad

Answer this question