How to wait until ProfileService finishes loading?

I want to know how I would wait until ProfileService is ready to use.

This is what I tried:

function module.WaitUntilLoad(player)
	return ProfileService.IsLive()

My code seems like it works because it prints after this:

but the profile is still nil.

ProfileService: Save your player data with ProfileService! (DataStore Module)

1 Like
repeat task.wait() until ProfileService.IsLive()
1 Like

Tried this but it doesn’t really make much of a difference. It said that ProfileService.IsLive would yield so I don’t think you would need to use a loop.