Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Unable to use GetPlayerPlaceInstanceAsync and TeleportToPlaceInstance?

I have a game that teleports a player to their friends game if their friend is on that game. Everytime I run TeleportToPlaceInstance, there is no chance of Success, its always this error. "Target place is not part of the current game"

....
print(text)
if text==nil or text=="[]" then
	for a=5,1,-1 do
		script.Parent.Frameb.TextLabel.Text="User "..name.." is online but not in a game. Checking in "..a
		wait(1)
	end 
else
	local a,b=string.find(text,[[class="notranslate">]])
	local c,a=string.find(text,[[</span>]])
	script.Parent.Frameb.TextLabel.Text="User "..name.." is online on game "..text:sub(b+1,c-1)..". Getting server information!"
	wait(2)
	local Success, Error, placeId, instanceId = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(id)
	if Success then 
		script.Parent.Frameb.TextLabel.Text="STARTING PLACETP TO "..text:sub(b+1,c-1).." WITH "..name
		game:GetService("TeleportService"):TeleportToPlaceInstance(placeId,instanceId,script.Parent.Parent.Parent.Parent)
		wait(130)
	else
		print(Error)
		script.Parent.Frameb.TextLabel.Text="Trying agian shortly. <"..Error..">"
		wait(2)
	end
end 
.....

Yes the UserID is correct. Variable id Yes the Username is correct. Variable name. Yes the Game's Name that the User is in is correct. Variable text:sub(b+1,c-1).

2 comments

0

Any output?

0

I said that the output was "Target place is not part of the current game"

1 answer

These only work in one universe - make sure all the games the players are teleporting to are located in the same universe.

3 comments

0

Wow, that blows. I thought this getplayerplaceinstanceasync and teleporttoplaceinstance would let me just place teleport someone to their game that they are in. Roblox, update your wiki, you never said anything about universes in it.

0

I know; I tried the same sort of thing when I read that wiki page.

1

Consider it updated.

This discussion is preserved as it was. New answers, comments, and votes are closed.