-- Roblox Empty / Low-Player Server Hop Script (Mobile Optimized) local CoreGui = game:GetService("CoreGui") local Players = game:GetService("Players") local TeleportService = game:GetService("TeleportService") local HttpService = game:GetService("HttpService") local LocalPlayer = Players.LocalPlayer -- Remove old GUI if it exists if CoreGui:FindFirstChild("EmptyServerHopUI") then CoreGui.EmptyServerHopUI:Destroy() end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "EmptyServerHopUI" ScreenGui.Parent = CoreGui local TextButton = Instance.new("TextButton") TextButton.Parent = ScreenGui TextButton.BackgroundColor3 = Color3.fromRGB(0, 200, 0) -- Green background TextButton.Position = UDim2.new(0.05, 0, 0.1, 0) TextButton.Size = UDim2.new(0, 150, 0, 50) TextButton.Font = Enum.Font.SourceSansBold TextButton.Text = "Start" TextButton.TextColor3 = Color3.fromRGB(255, 255, 255) TextButton.TextSize = 20 -- Add rounded corners local UICorner = Instance.new("UICorner") UICorner.CornerRadius = UDim.new(0, 10) UICorner.Parent = TextButton -- Add black border/stroke (حواف سوداء) local UIStroke = Instance.new("UIStroke") UIStroke.Color = Color3.fromRGB(0, 0, 0) UIStroke.Thickness = 3 UIStroke.Parent = TextButton -- Add black shadow/glow effect (هالة سوداء) local ImageLabel = Instance.new("ImageLabel") ImageLabel.Name = "Shadow" ImageLabel.BackgroundTransparency = 1 ImageLabel.Position = UDim2.new(0, -12, 0, -12) ImageLabel.Size = UDim2.new(1, 24, 1, 24) ImageLabel.ZIndex = TextButton.ZIndex - 1 ImageLabel.Image = "rbxassetid://6015897843" ImageLabel.ImageColor3 = Color3.fromRGB(0, 0, 0) ImageLabel.ImageTransparency = 0.4 ImageLabel.ScaleType = Enum.ScaleType.Slice ImageLabel.SliceCenter = Rect.new(49, 49, 450, 450) ImageLabel.Parent = TextButton -- Function to hop to an empty or lowest-player server local function hopToBestServer() TextButton.Text = "Searching..." local success, serverList = pcall(function() -- طلب قائمة السيرفرات بطريقة مدعومة local url = "https://games.roblox.com/v1/games/" .. game.PlaceId .. "/servers/Public?sortOrder=Asc&limit=100" return HttpService:JSONDecode(game:HttpGet(url)) end) if success and serverList and serverList.data then -- 1. محاولة البحث عن سيرفر فارغ تماماً (0 لاعبين) أو فيه لاعب واحد for _, server in ipairs(serverList.data) do if server.id ~= game.JobId and server.playing and server.playing <= 1 then TextButton.Text = "Joining..." TeleportService:TeleportToPlaceInstance(game.PlaceId, server.id, LocalPlayer) return end end -- 2. إذا لم يجد، يبحث عن أقل سيرفر فيه ناس (تصاعدياً من الأقل للأكثر) table.sort(serverList.data, function(a, b) return a.playing < b.playing end) for _, server in ipairs(serverList.data) do if server.id ~= game.JobId and server.playing < server.maxPlayers then TextButton.Text = "Joining..." TeleportService:TeleportToPlaceInstance(game.PlaceId, server.id, LocalPlayer) return end end end -- حل بديل أخير إذا فشل جلب القائمة لأسباب تتعلق بالحماية TextButton.Text = "Retrying..." TeleportService:Teleport(game.PlaceId, LocalPlayer) task.wait(3) TextButton.Text = "Start" end TextButton.MouseButton1Click:Connect(function() pcall(hopToBestServer) end)