Profile in ProfileService returning nil

Hey Guys!

So I’m currently trying to access a profile to get its data than to display it on a Gui. we don’t need to talk about the Gui though as its working fine. I am also using sleitnicks Knit and made my profile module a service. I’ve tried literally trying to access the profile directly from the module script just like how you would in the profileservice documentation. It returned nil. I tried to create a remote function with knit but it also prints nil. I feel like it’s because the profile has not been setup and put in the profiles table yet when I’m trying to access it from this script, but I have no clue how to implement this. It might also be a problem I have no idea about so anything helps!

Knit.OnStart():andThen(function()
		local DataService = Knit.GetService("DataService")
		self.Profile = DataService:ReturnProfile():andThen(function(profile)
			print("Started")
			print(profile)
		end)
	end)
function DataService.Client:ReturnProfile(player: Player)
	local Profile = DataService.Profiles[player]
	if not Profile then return end
	
	return Profile
end

Haven’t fully understood the question but have you tried putting a wait in to see if it’s the player not being loaded into the datastore yet?

Sorry for you troubles But I’ve already solved it.

If you would like to replicate data from profileservice to client I would highly recommend using ReplicaService!

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