Server Rejoin
Key RequiredUniversal

Server Rejoin

Universal Scriptdavy_jones_sorindodavy_jones_sorindo 4.7K views 20 executesUpdated Jan 11, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•192 lines (6877 chars)
local HttpService = game:GetService("HttpService")
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")

local ScreenGui = Instance.new("ScreenGui")
local MainFrame = Instance.new("Frame")
local Header = Instance.new("Frame")
local MinimizeButton = Instance.new("TextButton")
local CloseButton = Instance.new("TextButton")
local AlertButton = Instance.new("TextButton")
local JobListFrame = Instance.new("ScrollingFrame")
local UIListLayout = Instance.new("UIListLayout")
local TitleLabel = Instance.new("TextLabel")
local AlertFrame = Instance.new("Frame")
local AlertLabel = Instance.new("TextLabel")

local JobList = {}
local isMinimized = false
local isAlertVisible = false

local function saveJobIds()
    writefile("server_log.json", HttpService:JSONEncode({Jobs = JobList}))
end

local function loadJobIds()
    if isfile("server_log.json") then
        local data = readfile("server_log.json")
        JobList = HttpService:JSONDecode(data).Jobs or {}
    end
end

ScreenGui.Parent = game.CoreGui
MainFrame.Parent = ScreenGui
MainFrame.Size = UDim2.new(0, 500, 0, 400)
MainFrame.Position = UDim2.new(0.5, -250, 0.5, -200)
MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
MainFrame.BorderSizePixel = 2
MainFrame.Active = true
MainFrame.Draggable = true

Header.Parent = MainFrame
Header.Size = UDim2.new(1, 0, 0, 40)
Header.BackgroundColor3 = Color3.fromRGB(25, 25, 25)

MinimizeButton.Parent = Header
MinimizeButton.Size = UDim2.new(0, 30, 0, 30)
MinimizeButton.Position = UDim2.new(1, -60, 0, 0)
MinimizeButton.Text = "-"
MinimizeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
MinimizeButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
MinimizeButton.BorderSizePixel = 0

CloseButton.Parent = Header
CloseButton.Size = UDim2.new(0, 30, 0, 30)
CloseButton.Position = UDim2.new(1, -30, 0, 0)
CloseButton.Text = "X"
CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
CloseButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
CloseButton.BorderSizePixel = 0

AlertButton.Parent = Header
AlertButton.Size = UDim2.new(0, 30, 0, 30)
AlertButton.Position = UDim2.new(1, -90, 0, 0)
AlertButton.Text = "?"
AlertButton.TextColor3 = Color3.fromRGB(255, 255, 255)
AlertButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
AlertButton.BorderSizePixel = 0

JobListFrame.Parent = MainFrame
JobListFrame.Size = UDim2.new(1, -20, 1, -60)
JobListFrame.Position = UDim2.new(0, 10, 0, 40)
JobListFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
JobListFrame.BorderSizePixel = 0
JobListFrame.ScrollBarThickness = 8

UIListLayout.Parent = JobListFrame
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0, 10)

TitleLabel.Parent = Header
TitleLabel.Size = UDim2.new(0, 180, 0, 30)
TitleLabel.Position = UDim2.new(0, 10, 0, 0)
TitleLabel.Text = "Server Rejoin"
TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
TitleLabel.BackgroundTransparency = 1
TitleLabel.TextSize = 18
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
TitleLabel.TextYAlignment = Enum.TextYAlignment.Center

AlertFrame.Parent = MainFrame
AlertFrame.Size = UDim2.new(1, -20, 0, 80)
AlertFrame.Position = UDim2.new(0, 10, 0, 300)
AlertFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
AlertFrame.BorderSizePixel = 2
AlertFrame.Visible = false

AlertLabel.Parent = AlertFrame
AlertLabel.Size = UDim2.new(1, 0, 1, 0)
AlertLabel.Text = "Warning: Server Rejoin only works if you're in the game you were originally joined in. You cannot teleport from one game to another."
AlertLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
AlertLabel.BackgroundTransparency = 1
AlertLabel.TextSize = 14
AlertLabel.TextWrapped = true

local function createJobButton(jobId, placeId, index)
    local JobButtonFrame = Instance.new("Frame")
    local JobLabel = Instance.new("TextLabel")
    local ButtonContainer = Instance.new("Frame")
    local JoinButton = Instance.new("TextButton")
    local RemoveButton = Instance.new("TextButton")

    JobButtonFrame.Size = UDim2.new(1, 0, 0, 80)
    JobButtonFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
    JobButtonFrame.BorderSizePixel = 0
    JobButtonFrame.BackgroundTransparency = 0.1

    JobLabel.Parent = JobButtonFrame
    JobLabel.Size = UDim2.new(0.6, -5, 1, 0)
    JobLabel.Position = UDim2.new(0, 5, 0, 5)
    JobLabel.Text = "Server " .. index  -- Exibindo "Server (número)"
    JobLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    JobLabel.BackgroundTransparency = 1
    JobLabel.TextXAlignment = Enum.TextXAlignment.Left
    JobLabel.TextSize = 14

    ButtonContainer.Parent = JobButtonFrame
    ButtonContainer.Size = UDim2.new(0.4, 0, 1, 0)
    ButtonContainer.Position = UDim2.new(0.6, 0, 0, 0)
    ButtonContainer.BackgroundTransparency = 1
    ButtonContainer.LayoutOrder = 1

    JoinButton.Parent = ButtonContainer
    JoinButton.Size = UDim2.new(0.45, 0, 1, 0)
    JoinButton.Position = UDim2.new(0, 0, 0, 0)
    JoinButton.Text = "Join"
    JoinButton.TextColor3 = Color3.fromRGB(255, 255, 255)
    JoinButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
    JoinButton.TextSize = 14
    JoinButton.MouseButton1Click:Connect(function()
        TeleportService:TeleportToPlaceInstance(placeId, jobId, Players.LocalPlayer)
    end)

    RemoveButton.Parent = ButtonContainer
    RemoveButton.Size = UDim2.new(0.45, 0, 1, 0)
    RemoveButton.Position = UDim2.new(0.55, 0, 0, 0)
    RemoveButton.Text = "Remove"
    RemoveButton.TextColor3 = Color3.fromRGB(255, 255, 255)
    RemoveButton.BackgroundColor3 = Color3.fromRGB(255, 70, 70)
    RemoveButton.TextSize = 14
    RemoveButton.MouseButton1Click:Connect(function()
        table.remove(JobList, index)
        saveJobIds()
        JobButtonFrame:Destroy()
    end)

    JobButtonFrame.Parent = JobListFrame
end

loadJobIds()
for index, jobId in ipairs(JobList) do
    createJobButton(jobId, game.PlaceId, index)
end

if not table.find(JobList, game.JobId) then
    table.insert(JobList, game.JobId)
    saveJobIds()
end

MinimizeButton.MouseButton1Click:Connect(function()
    isMinimized = not isMinimized
    if isMinimized then
        MainFrame.Size = UDim2.new(0, 500, 0, 40)  -- Minimiza a altura do HUD
        JobListFrame.Visible = false  -- Oculta a lista de servidores
        AlertFrame.Visible = false  -- Oculta o alerta
    else
        MainFrame.Size = UDim2.new(0, 500, 0, 400)  -- Restaura a altura do HUD
        JobListFrame.Visible = true  -- Mostra a lista de servidores
        if isAlertVisible then
            AlertFrame.Visible = true  -- Mostra o alerta se estiver visível
        end
    end
end)

CloseButton.MouseButton1Click:Connect(function()
    ScreenGui:Destroy()
end)

AlertButton.MouseButton1Click:Connect(function()
    isAlertVisible = not isAlertVisible
    AlertFrame.Visible = isAlertVisible
end)

Features & Information

Disconnected from the server? No problems anymore, by using this script you can return to the server - You MUST execute to save the server - You cant go from one game to another Made with AI, but works :)

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts