#ProfileService taking too long to load data.
1 messages · Page 1 of 1 (latest)
function DataServiceServer.Init(self: DataServiceServer,dataKey,dataTemplate)
ProfileStore = ProfileService.GetProfileStore(dataKey, dataTemplate)
self.networker = Networker.server.new("DataService",self, {
self.Get
})
for _, player in Players:GetPlayers() do
task.spawn(DataServiceServer.Load, player)
end
Players.PlayerAdded:Connect(DataServiceServer.Load)
Players.PlayerRemoving:Connect(function(player)
if Profiles[player] then
Profiles[player]:Release()
end
end)
print(script.Name .. " Init")
end
function DataServiceServer.Load(Player: Player)
local profile = ProfileStore:LoadProfileAsync("Player_" .. Player.UserId)
if not profile then
Player:Kick("Data error, Please rejoin")
return
end
profile:AddUserId(Player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
Profiles[Player] = nil
if Player then
Player:Kick("Data error, Please rejoin")
end
end)
if not Player:IsDescendantOf(Players) then
return profile:Release()
end
Profiles[Player] = profile
local success, err = pcall(function()
leaderstats:Create(Player, profile)
end)
if not success then
warn("Leaderstats Error:", err)
profile:Release()
Player:Kick("Stats error, please rejoin")
end
end
The most likely problem is that you’re trying to use your profile in the UI before the profile has loaded.
Also check this out
https://madstudioroblox.github.io/ProfileService/troubleshooting/#profiles-take-over-7-seconds-to-load
isnt profilestore better?
Ye, i switched but same issue
Update everytime the Profile gets updated?