Serialization means to convert an object into that string, and deserialization is its inverse operation (convert a string to an object). NeedsDataService:SetAsync(plr.Data serialization: All Open Cloud endpoints require you to serialize all data before network transportation. If success and Needs_Data_Final ~= nil then Needs_Data_Final = NeedsDataService:GetAsync(plr.UserId) I see in the name of this thread that you also want to know how to save your data to a table which in my opinion is a much better approach, so I’ve fixed the pieces of your code that was not working which were that you were not using the data you got from the table so in the code I have edited for you I use the table which has the values stored in it, the second sort of issue is that you were not using a pcall when saving your data to the data store which could cause errors instead of catching them: local players = game:GetService("Players") ThirstGetAsync = NeedsDataService:GetAsync(plr.UserId) or 100 HungerGetAsync = NeedsDataService:GetAsync(plr.UserId) or 100 Local datastore = game:GetService("DataStoreService") Local players = game:GetService("Players") NeedsDataService:SetAsync(plr.UserId, NeedsPlayer) Players.PlayerRemoving:Connect(function(plr) NeedsPlayerStats.Name = "NeedsPlayerStats" Local NeedsPlayerStats = Instance.new("Folder") Players.PlayerAdded:connect(function(plr) Local NeedsDataService = datastore:GetDataStore("NeedsData") I guess to save, it is like this: local datastore = game:GetService("DataStoreService") I have a problem, and it is that I want to learn how to save values with tables, but I honestly don’t know how saving and loading data with tables works.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |