here i am! i hope my solution is right
alright so the code you made lets any server that sees the reserved server access code attempt teleportorivateserver using that same code! in practice, reserved server access codes are fragile when muliple servers attempt to use the same code concurrently or when a server other than the one that created (reserved) the code tries to use it, so this is what causes that anoying 773 errors youre seeing!! also your ServerHeartbeat:UpdateAsync stores only Server = privateServerCode which means no owner info, so all other servers read the code and then try to teleport their players to it. no owner metadata in heartbeat (no owner nor jobid) means nothing prevents non owner servers from calling teleport
so my idea is to have a script that subscribes to messages whose ownerjobiid matches the game.jobid, so owner will resolve userIds to Player objects and then call the teleport thingy. alright, make a new script then put it in serverscriptservice ok!
local MessagingService = game:GetService("MessagingService")
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local placeId = game.PlaceId
local TOPIC = "TeleportToOwner_" .. tostring(game.JobId)
local subMsg
local function TeleportToReserved(placeId, accessCode, players)
--playerobjs must be Player instancs from this server!
local maxAttempts = 4
local attempt = 1
while attempt <= maxAttempts do
local ok, err = pcall(function()
TeleportService:TeleportToPrivateServer(placeId, accessCode, players)
end)
if ok then
return true
else
warn("[OwnerSubscriber] teleport attempt", attempt, "failed:", tostring(err), "accessCode:", tostring(accessCode))
attempt = attempt + 1
task.wait(math.min(1 * attempt, 5))
end
end
return false
end
local function onMessage(message)
local payload = message.Data
if not payload or not payload.userIds or typeof(payload.userIds) ~= "table" then
return
end
--we rbuild Player objects that still exist on this server
local playerObjs = {}
for _, uid in ipairs(payload.userIds) do
local p = Players:GetPlayerByUserId(uid)
if p then
table.insert(playerObjs, p)
end
end
if #playerObjs == 0 then
warn("[OwnerSubscriber] no local players to teleport for payload:", payload.serverIndex)
return
end
local success = TeleportToReserved(payload.placeId or placeId, payload.accessCode, playerObjs)
if not success then
warn("[OwnerSubscriber] failed to teleport players for payload:", payload.serverIndex, "accessCode:", payload.accessCode)
end
end
--subscribe once right here
local ok, subError = pcall(function()
subMsg = MessagingService:SubscribeAsync(TOPIC, onMessage)
end)
if not ok then
warn("[OwnerSubscriber] failed to subscribe to", TOPIC, "err:", tostring(subError))
else
print("[OwnerSubscriber] subscribd to teleport topic:", TOPIC)
end
now back to the module script, what i see important is just the module.servercreate so now you first add messagingserivce on top of your scipt with the other services you got
--other services up there
local MessagingService = game:GetService("MessagingService")
i reworked your servercreate thing to actually use tht ownerid thing (and emssageservice) so in the end this may possibly make that teleport server possible
--add these 2 too
local msgPrefix = "TeleportToOwner_"
local maxRetries = 3
module.ServerCreate = function(number, MyServerid, Placeid)
if MyServerid == 0 then
return false
end
local privateServerCode
local ownerJobId
local attempt = number or 1
local maxAttempts = 4
local playerList = Players:GetPlayers()
if #playerList == 0 then
return false
end
--we do this to create heartbeat record ok
local successUpdate = pcall(function()
ServerHeartbeat:UpdateAsync(MyServerid, function(olddata)
olddata = olddata and typeof(olddata) == "table" and olddata or {}
--if record alresdy has a server (and posibly owner), we use it!
if olddata.Server and olddata.Owner then
privateServerCode = olddata.Server
ownerJobId = olddata.Owner
return olddata
end
privateServerCode = TeleportService:ReserveServer(Placeid)
ownerJobId = game.JobId
return { Server = privateServerCode, Owner = ownerJobId }
end, 600) --longer ttl while setup is in progress
end)
if not successUpdate or not privateServerCode or not ownerJobId then
warn("[ServerCreate] failed to reserve/read servr record for id:", MyServerid)
return false
end
--safeguard
pcall(function()
Data:UpdateAsync(1, function(data)
data = data or {}
data[#data+1] = privateServerCode
return data
end)
end)
--here we check if instance is the owner then perform that teleport thing i hope no errors
if ownerJobId == game.JobId then
while attempt <= maxAttempts do
local ok, err = pcall(function()
TeleportService:TeleportToPrivateServer(Placeid, privateServerCode, playerList)
end)
if ok then
print("[ServerCreate][Owner] Teleport succeeded. ownerJobId:", ownerJobId, "code:", privateServerCode)
return true
else
warn("[ServerCreate][Owner] teleport failed attempt", attempt, "err:", tostring(err),
"ownerJobId:", ownerJobId, "code:", tostring(privateServerCode), "players:", #playerList)
--clear heartbeat so other servers can try to recreate if needed
pcall(function()
ServerHeartbeat:UpdateAsync(MyServerid, function(old) return {} end)
end)
attempt = attempt + 1
task.wait(0.6 * attempt)
end
end
warn("[ServerCreate][Owner] all attempts failed for owner:", ownerJobId, "code:", privateServerCode)
return false
end
--if not the owner then we publish this server's player userids to the owner for teleportng
local userIds = {}
for _, plr in ipairs(playerList) do
table.insert(userIds, plr.UserId)
end
local payload = {
serverIndex = MyServerid,
placeId = Placeid,
accessCode = privateServerCode,
userIds = userIds,
fromJobId = game.JobId,
timestamp = os.time()
}
local topic = msgPrefix .. tostring(ownerJobId)
local published = false
for i = 1, maxRetries do
local ok, err = pcall(function()
MessagingService:PublishAsync(topic, payload)
end)
if ok then
published = true
break
else
warn("[ServerCreate] publish to owner failed etry", i, "err:", tostring(err), "topic:", topic)
task.wait(0.25 * i)
end
end
if not published then
warn("[ServerCreate] failed to handoff teleport to owner", ownerJobId, "code:", privateServerCode)
return false
end
--successfully handedoff the teleport request, owner will perform teleport and we done!!
return true
end
idk what i js did i tried my best 
hope it works though!