Memory stores are not the right thing to use for this type of case.
Correct me if I am wrong but I didn’t even use ReplicaService to replicate the data but it still works?
Server:
function module:UpdateCash(player, amount)
local profile = self:GetProfile(player)
if profile then
profile.Data.Cash += amount
player.leaderstats:WaitForChild("Cash").Value = profile.Data.Cash
ReplicatedStorage.SendCashData:FireClient(player, profile.Data) -- sending data here through remote event
end
end
Client
local ReplicatedStorage = game:GetService("ReplicatedStorage")
ReplicatedStorage:WaitForChild("SendCashData").OnClientEvent:Connect(function(cash)
print(cash)
end)
That’s literally called replication, you don’t need his module for it.
I was curious why did he still add that in his topic when you don’t even need the service to do so. Thanks.
You don’t need ReplicaService to use ProfileService.
You can replicate your data however you like from the server. ReplicaService however was made to simplify and optimize this process so you don’t have to write your own complex replication system. But many games don’t have that many or complex values and tables they need custom replication for so a system like this might be overkill.
Hey, what’s the occasion with creating multiple profiles? Is that recommended practice for profiles that could take up the 4MB limit per profile at an eventual date?
Hey how do I remove users data from game with ProfileService
local ProfileTemplate = {
Cash = 0,
Items = {},
LogInTimes = 0,
} -- TO WIPE THE PROFILE IT CAN JUST BE A BLANK TEMPLATE
----- Loaded Modules -----
local ProfileService = require(game.ServerScriptService.ProfileService)
----- Private Variables -----
local ProfileStore = ProfileService.GetProfileStore(
"PlayerData",
ProfileTemplate
)
ProfileStore:WipeProfileAsync(Your Profile Key Here)
Just wanted to let everyone know that if they are having trouble using the module by itself, you should try out the profile manager I made. It comes with a few extra features, and is similar to the datastore API.
Hey, thanks for this beatifull module… but how can I pass data between places?
For some reason it’s not working correctly when I do it. It is making an entire new profile.
My apologies for the rather goofy inquiry, but is there a way I could use ListKeysAsync with this?
Alr so for everyone that CANT send data between places this is not a module problem
So check your script. In my case the problem was the Slot data not being used correctly(Im adding a slot data that is used in the key for the actual char data and the thing was that the table was printing nil for some shitty roblox reason(i forgot the exact reason lol)).
I am working on a cross-server auction house system and I’m wondering if anyone can give me advice if this is the right approach.
Before anyone says it, I am not purely using MemoryStoreService due to all of the limitations. I am only using it to execute actions (Eg. I will have a queue of “buy item”, “list item” etc). When items are bought, I will send it via GlobalUpdates.
But anyway, my ProfileService questions:
I will assign a “host server” that listens to MemoryStore and does all the ProfileService commands.
-
Every X seconds this is executed to manage auctions:
-
First:
if auctionsProfile and auctionsProfile.MetaData.ActiveSession[2] == thisSession then
If the currently loaded profile exists and the JobId is equal to the current one, it’s the host server so auctions are managed here. The rest is in MemoryStoreService. -
Second: Load the profile via ViewProfileAsync (auctionsProfile), and check
if not profile.MetaData.ActiveSession then
If the ActiveSession is nil, that means the host server is dead so we make this server the host one. We LoadProfileAsync in this server.
So I have three questions:
- Is this the right approach?
- Is there a better way to load up the profile/set a “host” server? If I am reading the docs right, LoadProfileAsync by itself can only be loaded in one server, right? So it shouldn’t clash? That being said, I do feel it’s a bit messy loading it this way. Is there a better way?
- Via the api:
In rare cases, if the server crashes, the profile will stay locked until ForceLoaded by a new session.
. How can I check for this? I was thinkingMetaData.LastUpdate
but what if there are no changes to the profile for a while; does this timestamp not change?
TIA to anyone able to give me feedback/insight on this system.
Is there ANY possible way to disable server locking? If so, that would be very good for the overall module. That can allow more global things like a leaderboard.
perhaps make this module compatible with the new roblox update thing that listens to gdpr requests?
(CC. @AridTheDev )
You need the Stylus extension then add this to one of your styles, The Dark Reader isn’t really needed, Just put this code in stylus
@-moz-document url-prefix("https://madstudioroblox.github.io/ProfileService/") {
body {
background-color: black; /* change it to gray if it's too dark for you */
-webkit-text-fill-color: gray; /* replace this with any colors (note: it must be in text, not like (25, 25, 25) or "#fffffff") */
}
}
this is the result:
@-moz-document url-prefix("https://madstudioroblox.github.io/ProfileService/") {
body {
background-color: rgb(36, 36, 36);/* change it to gray if it's too dark for you */
-webkit-text-fill-color: white; /* replace this with any colors (note: it must be in text, not like (25, 25, 25) or "#fffffff") */
}
}
Hello, to be honest ProfileService shouldn’t isn’t the best way tool to make a auction house system…
The best way to make a auction system is a normal datastore or a normal memory store and call UpdateAync() to add,remove items
UpdateAsync handle properly cross server because when 2 server call it at the same time it will retry etc…
Either way is fine lol, Dark Reader just does it automatically for every light-theme website you use while with Stylus you need to change the css colors or whatever they’re called using code
thanks, but it’s a bit hard to see the codeblocks
you don’t need to code, you can go to https://userstyles.world to find some styles you can use, though I know either way is fine