Attempt to Teleport to a place that is restricted?

Hello,

I am making a “friend lookup”, and I have a feature that teleports the player to the player’s friend’s server. I have tried using GetPlayerPlaceInstanceAsync and Teleport, and none of them worked. I am currently using TeleportToPlaceInstance(), and it’s giving me a rough time. I HAVE 3rd PARTY TP’s ON, HTTP REQS ON, API SERVICES ON, AND I AM NOT DOING THIS IN STUDIO
Anyways, here is the portion of the script:

              join_button.Activated:Connect(function()
					local not_success, not_err = pcall(function()
						game["Teleport Service"]:TeleportToPlaceInstance(friend.PlaceId, game_id, plr)
					end)
					if not_success then
						print('Success!')
					else
						warn('Error occured!', not_err)
					end
				end)

Ignore how I named the variables.
Help is appreciated.

So I combined TeleportAsync and some TeleportOptions and got this:

              join_button.Activated:Connect(function()
					local options = Instance.new("TeleportOptions")
					options.ServerInstanceId = game_id
					game.ReplicatedStorage.TeleportAsync:FireServer(friend.PlaceId, {plr}, options)
				end)

Server:

game.ReplicatedStorage.TeleportAsync.OnServerEvent:Connect(function(plr, placeId, plr_table, options)
	local success, err = pcall(function()
		game["Teleport Service"]:TeleportAsync(placeId, plr_table, options)
	end)
	if success then
		print('Success')
	else
		warn(err)
	end
end)

If you guys are having the same issue, use TeleportAsync on the server and TeleportOptions

I think that happens when the other player is in a VIP server this player doesn’t have permission to join(isn’t on the VIP whitelist).

Nevermind, I solved my issues.
Thanks for the help though.

Make sure to post the solution in case this helps other people in the future.

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