You can literally watch a tutorial on ProfileService that explains it great. One such tutorial is from VectorThree.
i have but i dont use it because i dont understand it even after watching tutorials plus i’d rather make it myself so if i want to add anything i can know where to start
This just looks like a Roblox outage to me.
Yes I know. I wasn’t specific enough. I meant like, isn’t there a way to prevent this from happening, as in retrying to call the function?
I wouldn’t recommend it. Just use the DataStore from Roblox. What I do is I create a module script where, if a player joins, their data will be stored in a table. If they don’t have existing data, new data will be created. I store everything in this table, and when the player leaves, it gets saved.
Suphi’s Datastore Module is the best option rn imo.
Well, it has its downsides. I’d still prefer to use ProfileService over Suphi’s Datastore Module.
Thank you so much for creating this, I’m gonna use it for my little game named normal day.
I hope there won’t be any data losess like they happened (4 times they happened and they were pretty big)
if anyone interested what the data losses was so here u go: first and second data loss was the serial keys they were lost 2 times (idk why to this day) the third data loss was the players money and the fourth data loss was companies budget (basically 170k money reset thats alot tho i backed it up to somewhat around this value)
These two already explain by DataStore2 should not really be used anymore. You should either use the default Roblox Datastores with their new API and all that stuff or you can use ProfileService which I have given a link to a great video explaining how to use it above.
Edit: Roblox Datastores do provide versioning! (ProfileService does too)
Since the points value was not changed/updated, DataStore2 did not save the value.
Edit: Sorry for bumping.
Hey,
is there a Community Ressource for DataStore 2 on Discord or on any other Social Media? If so can you send me the link so I can discuss with someone because I have a lot of question for that
Hey so how do i get the current value of the datastore? Do i just do something like:
local stat = game.Players.bbackstab.leaderstats.Stat.Value
Hey!
I’m not entirely sure if I wrote this correctly: but I’m having the same warning every time I run the game.
I’m trying to save a table of keybinds that each Player can change, so that it will stay the same the next time they join.
Here is the code:
-- VARS ||
local Players = game:GetService("Players")
local Datastore2 = require(script.Parent.DataStore2)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Data_Sync = ReplicatedStorage.Remotes.DataSync
-- ||
local defaultkeybinds = {
Interact = Enum.KeyCode.E,
Console_Interact = Enum.KeyCode.ButtonX,
SecondaryInteract = Enum.KeyCode.F,
Console_SecondaryInteract = Enum.KeyCode.ButtonY,
CloseMenu = Enum.KeyCode.X,
Console_CloseMenu = Enum.KeyCode.ButtonB
}
Players.PlayerAdded:Connect(function(PLAYER)
local keybindDataStore = Datastore2("KEYBINDS", PLAYER)
local keybinds = keybindDataStore:Get(defaultkeybinds)
Data_Sync:FireClient(PLAYER, keybinds)
end)
Data_Sync.OnServerEvent:Connect(function(PLAYER, TABLE)
local keybindDataStore = Datastore2("KEYBINDS", PLAYER)
keybindDataStore:Combine("DATA", "KEYBINDS")
keybindDataStore:Set(TABLE)
end)
I’m specifically having trouble on the last function, it keeps throwing a: error when player left! Invalid at input.Interact because: Invalid type (EnumItem)
error whenever I leave the game.
Anyone know the issue and can help me troubleshoot?
I have a question, when I use Get() do I have to pass through the default value every time, I currently use Get() with the defaultValue when the player joins
is this module still relevant???
Is there a way to tell when the data is set with the :Set() function? My code has some errors because it continues to run before the new data has been set. For now I just use task.wait(1), but is there a better way to do this? My original post.
it’s easy to use. that’s all that matters. big games still use it, and it’s great for newcomers. don’t see why it shouldn’t be used.
I’m experiencing a frustrating issue where OnUpdate
is not returning the newest updated value.
local playerDataTable = {
playerSwords = thisPlayersDataStores.swordCollectionDataStore,
};
if playerDataTable.playerSwords:Get() == nil then
playerDataTable.playerSwords:Set({}) -> prints {}
end
playerDataTable.playerSwords:Get()[dreamSwordName] = true -> (does not print anything)
print(playerDataTable.playerSwords:Get()) -> Prints {["Basic Sword"] = true}
I converted the dictionary to an array, however I’m still experiencing the same exact behavior.
01:59:59.128 RESET - Server - PlayerItemFunctions:51
01:59:59.128 DATASTORE playerSwords SET TO {} - Server - Script:174
01:59:59.128 RESET - Server - PlayerItemFunctions:51
01:59:59.129 DATASTORE playerShields SET TO {} - Server - Script:174
01:59:59.694 playerShields the real value is ▼ {
[1] = "Shield"
} - Server - Script:178
01:59:59.694 playerSwords the real value is ▼ {
[1] = "Basic Sword"
} - Server - Script:178
Update: I completely overlooked this issue for 2 hours the reason was because I was not using datastore:Set(). While the method I was using was correct as it was a metatable, the callback was not being fired.
Sorry if this was asked already but is this ok to use as a way to reset the players data?
for example reseting the players saves when they reset it ex. pressing a button
but the thing is it would be a combined datastore but i wouldnt want to wipe the whole thing, just the saves.
edit: realized that is very stupid but i still have no idea how to wipe a certain combined key since doing SaveStorage:Set(nil) doesnt work