Teleport fail but it used to work

Please help I still got this issue Please please game:getService(“TeleportService”):TeleportToPlaceInstance(v.PlaceId, v.GameId, player)
that line of code used to work now doesn’t please help or is there another method?
I keep getting the error https://gyazo.com/2705d1d6777af1a3372fb93295565be2

I been looking up the teleport service on devforum but I couldn’t figure anything out. I been starving for 1 day.

Could you post your full code so we can spot any errors that you might have?

Additionally you can check out the TeleportToPlaceInstance Roblox Developer API Reference here which will probably help you.

local player = game.Players.LocalPlayer

function GetFriends(player) --I do not feel like upvaluing it

return player:GetFriendsOnline(200) --max is 200

end

local debounce =false

script.Parent.Refresh.MouseButton1Click:Connect(function()

if debounce ==false then

debounce =true

local Refresher = script.Parent.Frame:GetChildren()

for c = 1, #Refresher do

if Refresher[c].name == “friend” then

Refresher[c]:Destroy()

end

end

script.Parent.Redopage.Disabled=true

script.Parent.Redopage.Disabled=false

wait(10)

debounce=false

end

end)

local friends = GetFriends(game.Players.LocalPlayer)

for i,v in pairs(friends) do

local frame = game.ReplicatedStorage.friend:Clone()

frame.frname.Text = v.UserName

frame.Parent = script.Parent.Frame

frame.Visible=true

frame.ImageLabel.Image =“https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username=”…v.UserName

if v.PlaceId==4134714686 or v.PlaceId==4134617017 then

frame.Follow.Visible=true

frame.Invite.Visible=false

frame.Follow.Id.Value = v.VisitorId

local getplace = v.PlaceId

frame.Follow.MouseButton1Click:Connect(function()

game:getService(“TeleportService”):TeleportToPlaceInstance(v.PlaceId, v.GameId, player)

end)

else

frame.Invite.Visible=true

end

end

I already look at the teleport thing u sent me and i couldnt figure it out i was starving. please help

Btw that used to work so Idk why it wouldnt anymore. Like I didnt change it to cause it error so idk why.

Try using a pcall to catch the error from the service. Either you write in an auto-retry or something else to make it more convenient for the player that they are not forced to leave to play it.

1 Like

how would i do that? Can you help?

Pcalls - When and how to use them is the right tutorial about how to use them. Let’s say you wrap the teleport call in the pcall and then if it errors, the first value returned is a boolean whether it has successfully executed or not.

2 Likes

I tried still doesnt work but it just said teleport fail and doesn’t give me the error message

nvm it kinda work now I just force them to tp to the place