You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I randomly receive this error, typically when a player joins. This is very bad as it essentially does not allow the player to play the game at all unless they willingly rejoin.
I have no clue why this is happening and no idea how to reproduce it, Ive experienced it occur randomly as I join, although it does seem relatively rare (maybe 1/50 times)
Any ideas as to what could be causing this and how I can resolve it?
Here is the code snippet i have that handles player joining:
`
local function playerAdded(player)
local profile = ProfileStore:LoadProfileAsync('Player_'..player.UserId)
if (profile) then
if not profile.Data['Buildings'] then
profile.Data = decompressData(profile.Data)
end
profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
local plrData = Profiles[player].profile.Data
print(plrData)
local asStr = Http:JSONEncode(plrData)
print(#asStr)
Profiles[player] = nil
if (script.ProfilesLoaded:FindFirstChild(player.UserId)) then
script.ProfilesLoaded:FindFirstChild(player.UserId):Destroy()
end
player:Kick()
end)
if not (player:IsDescendantOf(plrs)) then
profile:Release()
else
local leaderstatsFolder = Instance.new('Folder')
leaderstatsFolder.Name = 'leaderstats'
leaderstatsFolder.Parent = player
Profiles[player] =
{
profile = profile,
leaderstats = leaderstatsFolder
}
local cashStat = Instance.new('StringValue')
cashStat.Name = 'Cash'
cashStat.Value = Common.shortCash(math.floor(profile.Data.Cash))
cashStat.Parent = leaderstatsFolder
local blocksMinedStat = Instance.new('IntValue')
blocksMinedStat.Name = 'Blocks Mined'
blocksMinedStat.Value = profile.Data.BlocksMined
blocksMinedStat.Parent = leaderstatsFolder
local val = Instance.new('StringValue')
val.Name = player.UserId
val.Parent = script.ProfilesLoaded
script.Listener.Update:Fire(player, 'ResourcesDiscovered', profile.Data.ResourcesDiscovered)
end
else
player:Kick()
end
end
`
The text was updated successfully, but these errors were encountered:
I randomly receive this error, typically when a player joins. This is very bad as it essentially does not allow the player to play the game at all unless they willingly rejoin.
I have no clue why this is happening and no idea how to reproduce it, Ive experienced it occur randomly as I join, although it does seem relatively rare (maybe 1/50 times)
Any ideas as to what could be causing this and how I can resolve it?
Here is the code snippet i have that handles player joining:
`
local function playerAdded(player)
local profile = ProfileStore:LoadProfileAsync('Player_'..player.UserId)
end
`
The text was updated successfully, but these errors were encountered: