Profile Service Question

Is it ok to use profile Service like so:


local ProfileService = require(script:WaitForChild('ProfileService')) --DATA STORE.

local function PlayerAdded(player)
  local Player_Stats = {
		
		LogInTimes_TOTAL = 0; --The TOTAL # of times the player has joined the game.
		Inventory = {};		
	}

   local GameProfileStore = services.ProfileService.GetProfileStore("test", Player_Stats)
	if GameProfileStore then
		local profile = GameProfileStore:LoadProfileAsync(tostring(Plr.UserId))
		if profile then
			print(profile)
		end
	end
end

I am new to using this so I am currently experimenting different ways that I can make profile service in my game. My question is will this method cause any delays or failures if put inside the playerAdded function

Also if anybody is interested in helping me further pls msg me. :slight_smile:

I don’t see any large design flaws here. Totally fine loading on playerAdded. You can then add some seperate API functions to retrieve the data from your module independant of any ‘real’ data loading.

1 Like