Save your player data with ProfileService! (DataStore Module)

Could you also show us how do you handle releasing of the profile?

Post updated with my releasing code.

Are you sure that profile:Release() is being processed?

So was using the module and ran into an error
image

This line was throwing the error

local profile = ProfileService:LoadProfileAsync("Player_" .. player.UserId)

Any ideas how to fix it. The player is not nil and is loaded when profile is called

Can you show us how do you require ProfileService?

image
image

ProfileService is child of the data module

:LoadProfileAsync() is a member of ProfileStore, not ProfileService. See the official example.

2 Likes

Does :LoadProfileAsync() with Forceload yield the code until it retrieves the profile from the datastore?

In other words does it behave synchronously?
Thanks

1 Like

The Async keyword implies that the given method will yield! Good question regardless, as this is not really a convention or anything.

2 Likes

Hey, is it possible to get a read-only copy of a users profile?
I want users to be able to create their own world and allow other users to join while they’re offline or not necessarily in it

I’ve a predicament about using profileservice as a in-game guild manager. How would I add a player to a guild(Data.Members), while a player in another server does likewise without it throwing an error or messing up the data of the guild?

Couldn’t this be extended to use MemoryDatastore for caching with session locks that don’t always have to use datastores?

This is what loleris said while ago.

2 Likes

I second this. ProfileService on the Wally Package Manager by Uplift Games would help out a ton of developers using the Wally/Rojo Workflow. @loleris Please consider uploading ProfileService as a package on wally :pray:

5 Likes

My game has way too many data lines stored and I might be unable to store anymore values, how would I fix this?

How do I go about adding a new value to a profile without messing with data.
image
I am adding levels to my game and need to make it save with profile service, while not messing with my other values.

“levels” is currently nil, and I can check if it is nil with an if statement. Where do I go from after confirming that it is nil, so it saves the levels and doesnt end up with this error:
image

store shorkt key values together
example time played
–A most efficient (least fun to access trough code)

Timeplayed = {Dagger,Hellion,BoStaff}
Timeplayed = {100,2000,4000}

and access them by Timeplayed[1],Timeplayed[2],Timeplayed[3],
–example B easier to code with but less efficient cause u storing unusfull names that u don’t need
or Timeplayed = {["Dagger"]=100,["Hellion"]=2000,["BoStaff"]=4000}
this way u can fit more just dont exceed the key value limit

1 Like

does profiler service have check to see if datastore is offline on roblox?
if not i have to add my own just wondering

example datastore is offline player joins it might think its a new player cause no profile
then he leaves datastore back online and it save it as a new player over the old one

if its not added then i would prob check with vanilla datastore check if the datastore “game” has a key called “StoreOnline” value “yes”

before i load player profile i check if the key StoreOnline is found if not datastore offline and don’t load nor save

if it is found then if profile not found its new player

but i might not need this at all if it is already build into profiler service just askin if it is bacause can’t seem to find anything about it being mentioned

Of course it has these checks to prevent your data from being corrupted.

1 Like

ok nice then i don’t have to check myself awsome