I am working on a game lobby that will allow player to join into a game if they search for a friends player name, but I have not been able to find any way to get the userId from the player's name. The two players will probably not be in the same lobby either.
This is what I have so far
local teleService = game:GetService("TeleportService") module.GetPlayerLocation = function(playerName) local userId --convert player's name (playerName) into their userId local success, errorMsg, placeId, instanceId = teleService:GetPlayerPlaceInstanceAsync(userId) if (success) then return placeId, instanceId else return false end end
You need to use this function:
int GetUserIdFromNameAsync ( string userName )
Hope this helps