I’m absolutely stuck on how to make a player join system, where player A would input player B’s username into a textbox and be teleported to their server. If anyone could point me in the general right direction on how to go about doing this, it would be appreciated.
I’ve searched the devfourm for any topics and I don’t know if it’s just my wording but if this has already been asked and answered a link to that would be cool.
EDIT:
I know what I need to gather, I need to gather player B’s userID to get their placeID and jobID, but I have no idea about how I could get it without player B being in player A’s game.
Yeah, I know that I need to use teleport service, but how would I go about getting the placeID and jobID for player B’s server? Once I get those, it would be quite simple to teleport player A to the correct place and server.
I didnt clearly understand what you mean but in server systems, there is a host always so you dont have to care about that roblox already makes it for you
I cleaned up the script a bit and I figured the playerid is unknown because it is not made as a variable and was just said without local. here is the fixed script:
local TS = game:GetService("TeleportService")
script.Parent.MouseButton1Click:Connect(function(plr)
local playerid = game.Players:GetUserIdFromNameAsync(script.Parent.Parent.TextBox.Text)
local ci, _, endplaceid, endserverid = TS:GetPlayerPlaceInstanceAsync(playerid)
TS:TeleportToPlaceInstance(endplaceid, endserverid, plr)
end)
First off, my apologies for not formatting my code correctly.
However, it still is returning that the playerID is unknown. I’ve tried it both in studio and in the roblox client, and yet it still doesn’t work.