Are you sure that you are getting the right module? Because model has been changed and I have already made tests in private servers and it was working all fine.
Yeah, Iâm using the one that got updated the 5th of this month. I donât get any errors at all, it just doesnât seem to save in private servers.
Okay, please send the code you are using and check that if the module you are using matches the source code in the post. As I stated before I tested with the code you sent just above this messages and it was all working fine. Old model is replaced by a new one, for some reason when I publish an update it wasnât updating the model.
local StoreData = DataStore.CreateData(Player, "ExtraData")
local PlayerData = StoreData.Data
local Notifications = PlayerData.Notifications
Everything is already created in another module using a default table. Nothing errors in it. Itâs when Iâm trying to get the current data. I couldnât find anything else in the API that could help.
There is another function for getting existing data, FindData. I forgot to update the API my bad.
Hey Iâm coming back to this because I really want it fixed. Have you found out the way to fix private server data not saving? Public servers will save data and such but private servers wonât save when leaving them and coming back to a private or public.
My Code:
-------------------- [[ VARIABLES ]] --------------------
local Module = require(script.Parent.Parent.Modules.Datastore)
-------------------- [[ SCRIPTING ]] --------------------
local Default = {
Slot1Name = "UNNAMED",
Slot2Name = "UNNAMED",
Slot3Name = "UNNAMED",
Slot4Name = "UNNAMED",
Slot5Name = "UNNAMED",
Notifications = {"Notification From Game Developer: Welcome!"},
}
game.Players.PlayerAdded:Connect(function(Player)
local PlayerDataFolder = Instance.new("Folder")
PlayerDataFolder.Name = "PlayerData"
local Slot1Name = Instance.new("StringValue",PlayerDataFolder)
Slot1Name.Name = "Slot1Name"
local Slot2Name = Instance.new("StringValue",PlayerDataFolder)
Slot2Name.Name = "Slot2Name"
local Slot3Name = Instance.new("StringValue",PlayerDataFolder)
Slot3Name.Name = "Slot3Name"
local Slot4Name = Instance.new("StringValue",PlayerDataFolder)
Slot4Name.Name = "Slot4Name"
local Slot5Name = Instance.new("StringValue",PlayerDataFolder)
Slot5Name.Name = "Slot5Name"
local PlayerData = Module.CreateData(Player, "ExtraData", Default)
PlayerData:Combine(Slot1Name, Slot2Name, Slot3Name, Slot4Name, Slot5Name)
PlayerDataFolder.Parent = Player
end)
This is old but did this get fixed?
Nope, itâs still an issue. I think the creator has left this project.
Hello! Sorry for the long delay. I had IRL events and couldnât be able work on the module. Going to look at your issue right now. Again, sorry for the delay.
EDIT: I just made a test in a private server with the code you have given to me, there is no problem about the code. You can also test that on a place you created with creating a free vip server. There must be something else that is making the code not work as intended. Are you using CreateData function more than once? CreateData function must be used only once per player. Then you need to call FindData function to get their existing data.
Can you share your other codes that uses modules functions to get whats making it not work as intended?
Here is my test about the problem. This was tested in a newly created game and a free vip server.
(PS: I made the folders name leaderstats to test it easier.)
Glad to see you back! I understand.
And nope the CreateData event is only referenced once. Itâs weird. Data will save on Public Servers 100% every time but Data will NEVER save on private servers even if I try to force save it using the script. It only started doing this to me when you updated and fixed the Callback error. Scrolling up in the topic here I can see thatâs when I first told you about the issue. Thereâs nothing off about my code and Iâve sent it to you multiple times and used your code youâve sent me but it still doesnât work.
No other scripts in my game use the Find or CreateData function. They all just change the values on the server and I expect the values to save themselves when someone leaves. Itâs just weird how it wonât save in Private Servers but will in Public.