Profile Service | What does template do?

I’m using ProfileService to store user data. I’m copying a folder of values to ServerStorage , where there’s a folder named PlayerData . Each user has their own folder within PlayerData containing their data. Is ProfileService suitable for this? Also, what does the ‘Template’ do in ProfileService ? Are all items in the template is what is going to be saved? Any help will be appreciated!

Yes, that is exactly what ProfileService is for.

It’s what the non existing profiles will default to.
Example:
Lets say a game has Cash = 10 in it’s template, if you join the game, you will start with 10 cash.

Now lets say your game is popular, it already has people playing it. Once you change the template to include a new data, that nobody had before, and you use profile:Reconcile() on new players joining, their profile will update to have that data, while keeping their already changed data.

I’m not the best at explaining, hopefully you understood it. If not, you can always just read the example code ProfileService offers. It explains everything. Basic Usage - ProfileService

1 Like

Just one more question. If I don’t include the value I want to save inside the Template will it not save?

I don’t really get your question. ProfileService will only save the data that are in the template, if that’s your question.

If you have Cash inside your template, you will have to update the Cash in the players profile’s data, which can be retrieved with profile.Data

EDIT: Answered both, because i was unsure which one you were asking

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.