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