Well, I decided to change the datastores of my game to DataStore2 since there is data loss in the normal DataStore, and according to the dataStore2 there is no data loss. The problem is the following script, I wrote it after seeing a tutorial, but it doesn’t save the data and I don’t know how this one works…
local Players = game:GetService("Players")
local DataStore2 = require(1936396537)
DataStore2.Combine("Data", "Money")
local defaultMoney = 65
Players.PlayerAdded:Connect(function(player)
local Data_player = Instance.new("Folder", player); Data_player.Name = "other"
local MoneyValue = Instance.new("IntValue", Data_player); MoneyValue.Name = "Money"
local moneyStore = DataStore2("Money", player)
local function UpdateMoney(money)
player["other"].Dinero.Value = money
end
UpdateMoney(moneyStore:Get(defaultMoney))
moneyStore:OnUpdate(UpdateMoney)
end)
Apparently it only works when entering the normal roblox, not the one in the study, so I add more amount to the value of the DataStore2 value and it does not save them.
Also sometimes the IntValue of the dataStore does not appear