I’ve been trying to make a server list type system for a game, where you can create a server and then it’ll appear for others.
I have began getting the following error message:
“Reserve server access code should not be provided with instanceId.”
This error has NO documentation at all, there is absolutely nothing from what I’ve found searching the devforum, or looking it up.
This is the block of code that causes the issues:
local DataStoreService = game:GetService("DataStoreService")
local ServerAccessCodes = DataStoreService:GetDataStore("ReservedServerAccessCodes")
local function teleportPlayer(touch, sID, jID) --sID = privateServerId, jID = jobId (the server im trying to get players into)
local p = game.Players:GetPlayerFromCharacter(touch.Parent)
local accessCode = sID ~= "" and ServerAccessCodes:GetAsync(sID) --gets an access code from the datastore
local tpOptions = Instance.new("TeleportOptions")
tpOptions.ReservedServerAccessCode = accessCode
tpOptions.ServerInstanceId = jID
if p then
tpService:TeleportAsync(game.PlaceId, {p}, tpOptions) --errors here
end
end
Thanks in advance.