I'm trying to make a join player GUI by having a TextBox where you put their username in and a TextButton where you click to join. I already made the GUI and script. But the script don't work or function properly. Any help (Thanks)?

Code:

local teleportService = game:GetService'TeleportService'
local player = script.Parent.Parent.Parent.Parent

function onClicked()
    local validPlayer, targetUserId = pcall(game.Players.GetUserIdFromNameAsync, game.Players, script.Parent.Text)
    if validPlayer then
        local isOnline, success, errorMsg, placeId, instanceId = pcall(teleportService.GetPlayerPlaceInstanceAsync, teleportService,targetUserId)
        if isOnline and success then
            teleportService:TeleportToPlaceInstance(placeId, instanceId, player)
		end
	end
print("Working?")
end
script.Parent.MouseButton1Click:connect(onClicked)

GUI Properties: https://imgur.com/a/cWvTAUG