Profile Service Data Issue with Teleport through Servers

Hello Everyone…
im using Profile service as a dataStore
and i have a button that server hops but the issue everytime it teleports the player it kick the player saying “Disconnected From the game, please Reconnect” and it doens’t even say Kicked it just displays this text and i tried to look for it in all my scripts but couldn’t find it, maybe im just doing the teleport wrong this is my script

Script1
rep.Remotes.ServerHopEvent.OnServerEvent:Connect(function(player, serverid)
		local profile = PlayerData.Profiles[player]
		if profile then
			profile:Release()
			profile:ListenToHopReady(function()
					if serverid then
						TeleportService:TeleportToPlaceInstance(game.PlaceId, serverid, player)
					else
						TeleportService:TeleportAsync(game.PlaceId, {player})
					end
				end)
		else
			warn("Failed to release profile for player: " .. player.Name)
		end
end)

and sometimes it kicks the player with this function

Script2
local function PlayerAdded(player)
	local profile = ProfileStore:LoadProfileAsync("Player_" .. player.UserId)
	if profile ~= nil then
		profile:AddUserId(player.UserId) -- GDPR compliance
		profile:Reconcile() -- Fill in missing variables from ProfileTemplate (optional)

		profile:ListenToRelease(function()
			PlayerData.Profiles[player] = nil
		end)

		if player:IsDescendantOf(players) == true then
			PlayerData.Profiles[player] = profile
			LeaderStats(player, PlayerData.Profiles[player])
			rep:WaitForChild("Remotes"):WaitForChild("DataLoaded"):FireClient(player)
		else
			-- Player left before the profile loaded:
			profile:Release()
		end
	else
		-- The profile couldn't be loaded possibly due to other
		--   Roblox servers trying to load this profile at the same time:
		player:Kick("Couldn't Load Players Data, Please Rejoin The Game")
	end
end

3 Likes

Ad some delay profile service needs time to load

1 Like

sorry but where exactly do i put the delay?

1 Like

After the player added event I mostly add 10-15 seconds with a custom loading screen shown to the player so they not see random things loading in etc

1 Like

sadly didn’t fix the issue, thank you for trying

1 Like