local TeleportService = game:GetService("TeleportService")
local Text = script.Parent.FriendName.Text
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
Text = script.Parent.FriendName.Text
local FoundPlayer = game.Players:GetUserIdFromNameAsync(Text)
if FoundPlayer then
print(FoundPlayer)
local function followPlayer(Player, FoundPlayer)
local success, errorMsg, placeId, instanceId = TeleportService:GetPlayerPlaceInstanceAsync(FoundPlayer)
if success then
TeleportService:TeleportToPlaceInstance(placeId, instanceId, Player)
else
print("Teleport error:", errorMsg)
end
end
followPlayer(Player, FoundPlayer)
end
end)
I am trying to allow the player to teleport to another player once a players name is entered and a gui button is clicked but i just get the error
TeleportService::GetPlayerPlaceInstanceAsync can only be called from the server.

1 comment
i wanted to learn this too..