Reserve Server System

I am trying to make a server system like a story game/ TDS

This happens sometimes for some reason

I tried change the ids and remaking the places but that didn’t work

game.ReplicatedStorage.ServerCreation.ListUpdater.OnServerEvent:Connect(function(player,creator, member, num)
	game.ReplicatedStorage.ServerCreation.ListUpdater:FireAllClients(creator, member, num)

end)
local tpsACCESS = 0
local Players = game.Players
local TeleportService = game:GetService("TeleportService")
local list = {}
--local id = 10229522227 -- change this place id, if you want your 1st place.
--local id2 = 10939979087 -- change this place id, if you want your 2nd place.
--local id3 = 11782799691 -- change this place id, if you want your 3rd place.
--local id4 = 0020 -- change this place id, if you want your 4th place.
--local id5 = 094 -- change this place id, if you want your 5th place.
--local id6 = 1234 -- change this place id, if you want your 6th place.

local id = 10229522227 -- FOR TESTING ONLY
local id2 = 10939979087 -- change this place id, if you want your 2nd place.
local id3 = 11782799691 -- change this place id, if you want your 3rd place.
local id4 = 125 -- change this place id, if you want your 4th place.
local id5 = 124 -- change this place id, if you want your 5th place.
local id6 = 123 -- change this place id, if you want your 6th place.

game.ReplicatedStorage.ServerCreation.Teleportation.OnServerEvent:Connect(function(player, memberList, creator, servertype)

	game.ReplicatedStorage.ServerCreation.Teleportation:FireAllClients(memberList, creator)
	wait(5)
	if servertype == 'City' then
		tpsACCESS = TeleportService:ReserveServer(id)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,memberList)
		tpsACCESS = 0
	elseif servertype == 'Woodlands View' then
		tpsACCESS = TeleportService:ReserveServer(id2)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,memberList)
		tpsACCESS = 0
	elseif servertype == 'Millstone Port' then
		tpsACCESS = TeleportService:ReserveServer(id3)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,memberList)
		tpsACCESS = 0
	elseif servertype == 'Coming2' then
		tpsACCESS = TeleportService:ReserveServer(id4)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,memberList)
		tpsACCESS = 0
	elseif servertype == 'Coming3' then
		tpsACCESS = TeleportService:ReserveServer(id5)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,memberList)
		tpsACCESS = 0
	elseif servertype == 'Coming4' then
		tpsACCESS = TeleportService:ReserveServer(id6)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,memberList)
		tpsACCESS = 0
	end
end)

game.ReplicatedStorage.ServerCreation.TeleportationMain.OnServerEvent:Connect(function(player, member)
	print(list)
	table.insert(list, member)

end)

game.ReplicatedStorage.ServerCreation.TeleportSolo.OnServerEvent:Connect(function(player, memberList, creator, servertype)
	game.ReplicatedStorage.ServerCreation.Teleportation:FireAllClients({player}, creator)
	print(servertype)
	wait(5)
	if servertype == 'City' then
		tpsACCESS = TeleportService:ReserveServer(id)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,{player})
		tpsACCESS = 0
	elseif servertype == 'Woodlands View' then

		tpsACCESS = TeleportService:ReserveServer(id2)

		TeleportService:TeleportToPrivateServer(id,tpsACCESS,{player})
		tpsACCESS = 0
	elseif servertype == 'Millstone Port' then
		tpsACCESS = TeleportService:ReserveServer(id3)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,{player})
		tpsACCESS = 0
	elseif servertype == 'Coming2' then
		tpsACCESS = TeleportService:ReserveServer(id4)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,{player})
		tpsACCESS = 0
	elseif servertype == 'Coming3' then
		tpsACCESS = TeleportService:ReserveServer(id5)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,{player})
		tpsACCESS = 0
	elseif servertype == 'Coming4' then
		tpsACCESS = TeleportService:ReserveServer(id6)
		TeleportService:TeleportToPrivateServer(id,tpsACCESS,{player})
		tpsACCESS = 0
	end
	tpsACCESS = 0
end)

2 Likes

When you calling the :TeleportToPrivateServer method, your first argument is the ID of the place the you are going to. It seems you have many IDs that you are transfering to, but you only use the variable id to all of em. Try replacing them with the suffix number, id2, id3, id4, etc…

Whenever you get a 773 ErrCode, always check this, and also that you have reserved the server to the right ID. THEY MUST MATCH! I suggest making a function to do all of this for you. It saves room and prevents mistakes.

function transferMembers(idOfPlace, members)
     tpsACCESS = TeleportService:ReserveServer(idOfPlace)
     TeleportService:TeleportToPrivateServer(id, tpsACCESS, members)
     -- tpsACCESS does not need to be set to 0, as ReserveServer returns a STRING.
end
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.