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

Problem with GetPlayerPlaceInstanceAsync?

Hello, I'm trying to make a friend teleport for my game. Inputting a User ID into a Text Box. Every time I try it, it gives me the same error.

HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden)

function followPlayer(targetUserId)

local placeId,instanceId, success = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(joinid.Text)
if success then
        teleport:TeleportToPlaceInstance(placeId, instanceId)
else
	print('fail')
end
end
 script.Parent.FriendFollow.MouseButton1Down:connect(followPlayer)

I'm really stuck on this one, I would appreciate any help that I could get.

1 answer

The function GetPlayerPlaceInstanceAsync returns a bool, string, int, and string in that order.

The first return value is a Boolean that tells you if the player you are looking for was found, the second gives you the error message (if one occurred), the third returns to you the PlaceId that the player was found in, and the last gives you the JobId of that server.

You have not assigned your variables correctly and therefore are getting an error when you get to line 5. A fix would to be to rearrange your variables declarations:

local success, errorMsg, placeId, instanceId = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(joinid.Text)

7 comments

0

I tried that, unfortunately; it didn't work. It still gives the same error.

0

Are you testing this in an actual server on Roblox (not studio)? Teleport Service will only work in online mode.

0

Yeah, I had a friend go into a place within the game and tried teleporting.

0

Hmmm, weird

0

Oh, I forgot. I'm using a local script, do I need to use a normal one?

0

It should work either way

0

BenLee? Does this still work?

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