Best way to store non-player data?

So there’s stuff like ProfileService and DataStore2 for storing player-related data.
Are there any modules for storing non-player data? Anything better than plain DataStore?

Hello

What do you mean? Is it for npc’s or what are you talking about.
You can also just use plain datastores for non-player data?

If you want to store fx: A daily store you can use a google spread sheet or glitch for hosting an database.

Do you mean like a BasePart? This actually depends on what you want to save.

Some developers uses an “ID System” where the ID represents a value, including objects.

I’m working on a game with an infinite procedurally generated map.

When you reach the edge of the world, you get teleported to another server, and the map continues.
It’s basically a grid of Reserved servers.

Let’s say I wanted lootable chests in the world:

  • → Player 1 grabs stuff from chest
  • → Player 1 walks off and leaves current world
  • —> Server gets server shuts down
  • ----> Player 2 joins same world

Player 2 should see the chest as looted.

I’d need to save world-specific data.
It’ll be a basic table with primitive values.

Is there anything I should watch out for with plain old DataStore?

Non-Player Data
Non-Player Data is data that can’t be saved unless you have some sort of scripts that saves non-player data if you are teleporting them to another game my best bet would be using TeleportService here are the properties that you should work on also the link

https://developer.roblox.com/en-us/api-reference/class/TeleportService
Variant GetLocalPlayerTeleportData ( ) Returns the teleportData the Players.LocalPlayer arrived into the place with

and here is also an example of how to set and get non-player data if you are teleporting them between games


Quotes

always use protected calls

won’t happen unless server-shuts-down and if it does nobody can join it unless it has every content deleted inside that server but you can use BindableEvents if you are saving data to make sure that it’s actually saved and the server is safe to shutdown

then my point in the above would work if using TeleportService

I’m not teleporting between games, I’m teleporting between Private servers.
Using GetLocalPlayerTeleportData is a bad idea. TeleportData can be spoofed by exploiters.

Using pcalls is a good tip, I’ll keep that in mind.

Shouldn’t you be able to give all things a unique ID and use :GetAsync(UNIQUE_ID) and :SetAsync(UNIQUE_ID) and save the things you want to save?

1 Like

yea, I’m just wondering if there are any pitfalls

Hello

You should look in to messaging service: Link and a tutorial!

Also you can use data stores… It just isnt efficient.

quote=“loleris, post:1, topic:667805”]

  • ProfileService is a profile object abstraction detached from the Player instance - this allows the developer to create profiles for entities other than players, such as: group-owned houses, savable multiplayer game instances, etc.
    [/quote]

Any chance?

2 Likes

Oh cool, I didn’t see that!
I’ve been using DataStore2 so far but I guess I’ll switch to ProfileService