How do I save / load values in a table by using DataStoreService?

Hello developers!!

I currently need help with a DataStore system. Assume that I have a table like this table below here

local tbl = {'Hello, World!!', 1, true, false}

I want to save the data in the table when the player leaves the game and load the data when the player joined the game that is in the table with DataStoreService. Does anyone know how can I save the data in the table by using DataStoreService?!?!

Since the table is called tbl, you would just put tbl in the content of your DataStore and it would save the entire table. DataStoreService is complicated, so you may want to check out a guide like this one: Datastore Tutorial for Beginners
Very watered down version, you use game.Players.PlayerAdded and game.Players.PlayerRemoving and connect it to a save and load function.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.