Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gs = game:GetService 'GuiService'
- local reconnectDisabledList = {
- [Enum.ConnectionError.DisconnectLuaKick] = true,
- [Enum.ConnectionError.DisconnectSecurityKeyMismatch] = true,
- [Enum.ConnectionError.DisconnectNewSecurityKeyMismatch] = true,
- [Enum.ConnectionError.DisconnectDuplicateTicket] = true,
- [Enum.ConnectionError.DisconnectWrongVersion] = true,
- [Enum.ConnectionError.DisconnectProtocolMismatch] = true,
- [Enum.ConnectionError.DisconnectBadhash] = true,
- [Enum.ConnectionError.DisconnectIllegalTeleport] = true,
- [Enum.ConnectionError.DisconnectDuplicatePlayer] = true,
- [Enum.ConnectionError.DisconnectCloudEditKick] = true,
- [Enum.ConnectionError.DisconnectOnRemoteSysStats] = true,
- [Enum.ConnectionError.DisconnectRaknetErrors] = true,
- [Enum.ConnectionError.PlacelaunchFlooded] = true,
- [Enum.ConnectionError.PlacelaunchHashException] = true,
- [Enum.ConnectionError.PlacelaunchHashExpired] = true,
- [Enum.ConnectionError.PlacelaunchUnauthorized] = true,
- [Enum.ConnectionError.PlacelaunchUserLeft] = true,
- [Enum.ConnectionError.PlacelaunchRestricted] = true,
- }
- gs.ErrorMessageChanged:connect(
- function()
- local error_code = gs:GetErrorCode()
- local error_type = gs:GetErrorType()
- if error_type == Enum.ConnectionError.DisconnectErrors and
- not reconnectDisabledList[error_code] then
- print('Disconnect registered!')
- while task.wait(5) do
- game:GetService 'TeleportService':TeleportToPlaceInstance(
- game.PlaceId, game.JobId)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment