100% found this document useful (1 vote)
246 views4 pages

Roblox Server Hopper Script Guide

Uploaded by

nguyenducvu1108
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
246 views4 pages

Roblox Server Hopper Script Guide

Uploaded by

nguyenducvu1108
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local Players = game:GetService("Players")

local TweenService = game:GetService("TweenService")


local HttpService = game:GetService("HttpService")
local TeleportService = game:GetService("TeleportService")

local LocalPlayer = [Link]


local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

-- Defaults
local UniverseId = [Link]
local PlaceId = [Link]
local AllIDs = {}
local TargetJobId = "" -- Dán JobId: "7eb10c6a-e87a-4b52-800d-188791ee2d0"
local TargetUniverseId = "" -- Dán UniverseId: "2753915549" (Blox Fruits)
local TargetPlaceId = "" -- Dán PlaceId: "744942336"

-- Update targets
if TargetUniverseId ~= "" then
UniverseId = tonumber(TargetUniverseId) or [Link]
end
if TargetPlaceId ~= "" then
PlaceId = tonumber(TargetPlaceId) or [Link]
end

-- Fix: Nếu UniverseId = 0, warn và dùng PlaceId fallback (nhưng API vẫn cần
Universe)
if UniverseId == 0 then
warn("Warning: UniverseId is 0! Use TargetUniverseId manually. Falling back to
PlaceId hop (limited).")
UniverseId = tonumber(TargetUniverseId) or 1 -- Dummy để tránh crash, nhưng
API sẽ fail
end

-- Function getServers (giữ nguyên, thêm pcall cho API)


local function getServers()
AllIDs = {}
local foundAnything = ""
local currentUrl = "[Link] .. UniverseId ..
"/servers/Public?sortOrder=Asc&limit=100"

repeat
local success, response = pcall(function()
return HttpService:JSONDecode(game:HttpGet(currentUrl))
end)

if not success or not response or [Link] then


print("API Error: " .. (response and [Link] and
[Link][1].message or "HttpGet failed"))
return false
end

-- Collect
for _, v in pairs([Link] or {}) do
local id = tostring([Link])
local maxPlayers = tonumber([Link]) or 0
local playing = tonumber([Link]) or 0
if playing < maxPlayers * 0.8 and maxPlayers > 0 then
[Link](AllIDs, id)
print("Found good server: " .. id .. " (Playing: " .. playing ..
"/" .. maxPlayers .. ")")
end
end

if [Link] and [Link] ~= "null" then


foundAnything = [Link]
currentUrl = currentUrl:gsub("&cursor=.*$", "") .. "&cursor=" ..
foundAnything -- Fix URL pagination
else
foundAnything = ""
end

wait(0.1)
until foundAnything == "" or #AllIDs >= 50

print("Total good servers found: " .. #AllIDs)


return #AllIDs > 0
end

-- Check JobId valid


local function isValidJobId(jobId)
if getServers() then
for _, id in pairs(AllIDs) do
if id == jobId then return true end
end
end
return false
end

-- Teleport
local function Teleport(targetId)
local jobId = targetId or (#AllIDs > 0 and AllIDs[[Link](1, #AllIDs)] or
nil)
if not jobId then
print("No server available!")
return
end
print("Hopping to PlaceId: " .. PlaceId .. " | Server: " .. jobId .. " |
Universe: " .. UniverseId)

local success, err = pcall(function()


TeleportService:TeleportToPlaceInstance(PlaceId, jobId, LocalPlayer)
end)

if not success then


print("Teleport failed: " .. tostring(err))
wait(5)
Teleport(targetId)
end
end

-- Main Hop logic (không print info mỗi lần, chỉ khi hop)
local function performHop()
print("=== HOP INITIATED ===")
print("UniverseId: " .. UniverseId .. " (Target: " .. (TargetUniverseId ~= ""
and TargetUniverseId or "Current") .. ")")
print("PlaceId: " .. PlaceId .. " (Target: " .. (TargetPlaceId ~= "" and
TargetPlaceId or "Current") .. ")")
if TargetJobId ~= "" then
print("Using target JobId: " .. TargetJobId)
if isValidJobId(TargetJobId) then
Teleport(TargetJobId)
else
print("Target JobId invalid! Random fallback.")
if getServers() then Teleport() else print("No servers!") end
end
else
if getServers() then Teleport() else print("No servers!") end
end
end

-- THÊM: Tạo GUI Toggle


local function createToggleGUI()
local screenGui = [Link]("ScreenGui")
[Link] = "ServerHopperGUI"
[Link] = game:GetService("CoreGui") -- Visible qua executor

local mainFrame = [Link]("Frame")


[Link] = [Link](0, 200, 0, 100)
[Link] = [Link](0, 10, 0, 10) -- Góc trên trái
mainFrame.BackgroundColor3 = [Link](50, 50, 50)
[Link] = 0
[Link] = screenGui

-- Nút Hop
local hopButton = [Link]("TextButton")
[Link] = [Link](1, 0, 0.6, 0)
[Link] = [Link](0, 0, 0, 0)
hopButton.BackgroundColor3 = [Link](0, 170, 0) -- Xanh
[Link] = "Hop Now"
hopButton.TextColor3 = [Link](1,1,1)
[Link] = [Link]
[Link] = 18
[Link] = mainFrame

-- Nút Close
local closeButton = [Link]("TextButton")
[Link] = [Link](1, 0, 0.4, 0)
[Link] = [Link](0, 0, 0.6, 0)
closeButton.BackgroundColor3 = [Link](170, 0, 0) -- Đỏ
[Link] = "Close GUI"
closeButton.TextColor3 = [Link](1,1,1)
[Link] = [Link]
[Link] = 14
[Link] = mainFrame

-- Events
hopButton.MouseButton1Click:Connect(performHop)
closeButton.MouseButton1Click:Connect(function()
screenGui:Destroy()
print("GUI closed.")
end)

-- Animate vào (optional)


mainFrame:TweenPosition([Link](0, 10, 0, 10), "Out", "Quad", 0.5, true)

print("Server Hopper GUI loaded! Press 'Hop Now' to hop.")


end

-- THÊM: Keybind (nhấn H để hop, optional)


game:GetService("UserInputService").InputBegan:Connect(function(input,
gameProcessed)
if gameProcessed then return end
if [Link] == [Link].H then
performHop()
end
end)

-- Init GUI (không auto hop)


createToggleGUI()

-- Info ban đầu (không hop)


print("=== SERVER HOPPER LOADED ===")
print("UniverseId: " .. UniverseId)
print("PlaceId: " .. PlaceId)
print("Current JobId: " .. [Link])
print("GUI ready. Click button or press H to hop!")

You might also like