Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- -- Fonction pour tenter de se reconnecter
- local function TryReconnect()
- print("Tentative de reconnexion...")
- game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, game.JobId, Player)
- end
- -- Écouteur d'événement pour la déconnexion
- Player.PlayerRemoving:Connect(function()
- print("Déconnexion détectée.")
- TryReconnect()
- end)
- -- Vérification périodique de l'état de la connexion (peut être inefficace)
- while true do
- wait(10) -- Vérifier toutes les 10 secondes
- if not Player:IsConnected() then
- TryReconnect()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement