I’ve a lobby and I have three types of servers: Practice, AI League, and Player League servers, I have a reservedserver script function that saves a datastore with all server tables (each table is {servername then servercode}) .
I want to be able to list server names from inside the game, however when I go through the server list, the PrivateServerId isn’t the same as the reserved code. Is there another way to tell the server what its name is? I wanna do this because league servers I wish to have replays play by default, and practice servers shouldn’t (because it’s for practice).
Not really, what I have is like, practice servers 1-12, league servers 1-6 (for AI and Players).
What I do is every time a person requests to join say AI Server 3 I check the datastore, if the datastore is nil, then it makes a newdata store with the data of {{“AI3”,(insert server reserve code here)}}. If it isn’t nil I add onto the datastore, doing this. table.insert(datatable,{“AI3”,(insert server reserve code here)}).
As example:
but when you load into a server, it tries to read this!
However, the data doesn’t match whatsoever, which makes 0 sense because on the wiki, it says the Reserved code is the servers PrivateServerId which it isn’t.
In Hockey World I transfer this information through the player teleportation and when the player joins the game server it will fire a remote to the server notifying the server what the server was, and then I close a debounce so that it can’t be fired again in that session to prevent exploiters, and it cannot be exploited because no one can inject synapse before the game loads
Server Script in game server: (Sorry kinda messy lol)
game:GetService("ReplicatedStorage").InitialData.OnServerEvent:Connect(function(Player, Data)
if game:GetService("ReplicatedStorage").GotData.Value == false then
game:GetService("ReplicatedStorage").GotData.Value = true
local ServerType = Data[1]
local ServerNumber = Data[2]
game:GetService("ReplicatedStorage").ServerType.Value = ServerType
game:GetService("ReplicatedStorage").ServerNumber.Value = ServerNumber
print(ServerType, ServerNumber)
end
end)
Local script inside game server: (Located inside of ReplicatedFirst)
--Services
local TeleportService = game:GetService("TeleportService")
function OnTeleportReceived(CustomLoadingScreen, TeleportData)
--Values
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GotData = ReplicatedStorage:WaitForChild("GotData")
if GotData.Value == false then
if TeleportData then
--Remotes
local InitialData = ReplicatedStorage:WaitForChild("InitialData")
InitialData:FireServer(TeleportData)
end
end
end
TeleportService.LocalPlayerArrivedFromTeleport:Connect(OnTeleportReceived)
I am now just confused why it wouldn’t work.
Could you show a bit more of your code as I don’t get where you got servertotpto got from and if the first/last code is inside a function.
Though, I think the issue lays inside the getservername function.
I did this before actually, it was the first thing I did, but people started using the game metatable to alter the remote event not to fire by making it wait like 9999+. So thats why I wanna use this so the clients can’t alter that.
I was doing more research and I found out you can get teleportdata without it being filtered on the server with player:GetJoinData(). I don’t know how while searching on google “transfer data between roblox servers” that didn’t show up, but it works I guess. ¯_(ツ)_/¯