Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Unable to use GetPlayerPlaceInstanceAsync and TeleportToPlaceInstance?

Asked by
Nickoakz 231 Moderation Voter
10 years ago

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).

0
Any output? fireboltofdeath 635 — 10y
0
I said that the output was "Target place is not part of the current game" Nickoakz 231 — 10y

1 answer

Log in to vote
0
Answered by
wrenzh 65
10 years ago

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

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. Nickoakz 231 — 10y
0
I know; I tried the same sort of thing when I read that wiki page. wrenzh 65 — 10y
1
Consider it updated. Articulating 1335 — 10y
Ad

Answer this question