My goal:
Accessing a sorted map with the reserved server’s PrivateServerId
The problem:
game.PrivateServerId returns an empty string, which should not happen because it is a reserved server.
Steps to replicate:
Starting place (server)
local MemoryStoreService = game:GetService("MemoryStoreService")
local playerCount = MemoryStoreService:GetSortedMap("PlayerCount")
local TELEPORT_OPTIONS = Instance.new("TeleportOptions")
TELEPORT_OPTIONS.ShouldReserveServer = true
local privateId , AccessCode = TeleportService:TeleportPartyAsync(14043699970 , Match.Players , TELEPORT_OPTIONS )
playerCount:SetAsync(privateId , count , 10800)
Destination place (server)
local MemoryStoreService = game:GetService("MemoryStoreService")
local PlayerCount = MemoryStoreService:GetSortedMap("PlayerCount")
game.Players.PlayerAdded:Connect(function(player : Player)
print(game.PrivateServerId)
local maxPlayers = PlayerCount:GetAsync(tostring(game.PrivateServerId) ) -- This line returns an error because game.PrivateServerId = ""
print(maxPlayers)
end)