I am trying to teleport to another server of the same game via a in game portal. but cant seem to get the findign another server to teleport to to work for me. the relevant script i am using is below.

local serverListDS = game:GetService("DataStoreService"):GetDataStore("ServerList");
local jobId = game.JobId;

for i,v in pairs (serverListDS:UpdateAsync("OpenServers"):GetChildren()) do
	if v.JobId ~= jobId then
		local u1 = v.jobId
		game:GetService("TeleportService"):TeleportToPlaceInstance(PlaceId, u1)
	end
end

3 comments

1

Please codeblock by selecting the code and pressing the lua button. Anyways why would you want to make this?

1

Basically, you didn't select the player that was supposed to teleport, so it errors

0

ok thanks, I'll try adding a player. to allow players to move between servers. expanded game play