Save your player data with ProfileService! (DataStore Module)

youre an actual legend i literally spent 3 hours trying to counter this issue
i literally tried JSONEncoding

I put ProfileService into my game and set it up using the official tutorial and I can’t get it to work no matter what. I made a forum post on it and no one else can figure out the problem either. If anyone can help please hit me up on discord my username is bloxikgames

Do you have API Enabled in your game settings.

I’ve already figured out a way to use DataStore service.

I don’t know if this is already asked, but how would I completely remove the auto save and let the Player only save the data store when I want him to (also includes not saving on leaving the game).

I was trying to figure that out myself, but wasn’t able to do it yet because sometimes it worked and sometimes it didn’t.

How would I go about accessing every profile for a server-wide leaderboard?

I want to make a leaderboard that tracks how many secret codes that every player that has every played the game finds, but I can’t seem to find out a way to do that.

I don’t think using ProfileService would be useful for that

1 Like

There is a Save function in ProfileService, just call that when needed to, and also to remove the data saving on leaving remove the following line from Profile:Release() (this is me guessing but should work)

		task.spawn(SaveProfileAsync, self, true) -- Call save function in a new thread with release_from_session = true

I just figured out that to also remove auto saving just run this in the code somewhere and make sure it never runs the autosave function

	RemoveProfileFromAutoSave(profile)
1 Like

Thanks for the answer, I appreciate it!

1 Like

You’re going to want to use ordered date stores for this.

Would someone like to tell me what this Module does to fight duplication exploits/issues except for session locking?

1 Like

it technically prevents oldest dupe method, “multi-client”
which still works for datastores that has no session lock and save only after player leave

Thanks for the answer!

However, my question was if it does something except session locking (which prevents the :GetAsync() - :Set/UpdateAsync() race condition).

1 Like

i don’t really have that much information about it
but ProfileService also has GlobalUpdate to send data between servers and players
though i never use it
i have seen it being usefull
(Global Updates takes : Min 30 Seconds, Max 8 Mins to reach if i remember right)

1 Like

if i remember right, ProfileService and all others are just a More secure version of Datastore because of Mock Store and other Stuff

also They all may have different load speeds depending on the way it is implemented.

1 Like

If anyone has further information about this, a response would be appreciated.

Could accessing profiles using multiple script simultaneously cause race condition issues?

Screenshot 2024-08-09 022257
I have just encountered this weird bug

Could someone help me out?

image

Does anyone know how to save tables I’m having problems saving them.

				if profile.Data and profile.Data.trucks and type(profile.Data.trucks) == "table" then
					for _, truck in ipairs(truckFolder:GetChildren()) do
						local truckName = truck.Name
						local truckValue = profile.Data.trucks[truckName]

						if truckValue ~= nil and type(truckValue) == "boolean" then
							truck.Value = truckValue
						end
					end
				end