When serverID enter, players aren't able to join servers

Just to check if I am on the right track for the local script

local ScreenGUI = script.Parent
local Players = game:GetService("Players")

local CreateBTN = ScreenGUI.ServerSelect.CreateServer
local JoinBTN = ScreenGUI.ServerSelect.JoinServer
local JoinTextBox = ScreenGUI.ServerID.TextBox
local CreaterPanel = ScreenGUI.Server.CreaterPanel

local ServerName = ScreenGUI.Server.ServerName
local ServerIDNum = ScreenGUI.Server.CreaterPanel["Server ID"].SERVERIDNumber

CreateBTN.MouseButton1Click:Connect(function()
    local ServerID, isPrivate = game.ReplicatedStorage.CreateServer:InvokeServer()
    if ServerID then
        print(ServerID)
		ScreenGUI.ServerSelect.Visible = false
		ScreenGUI.Server.CreaterPanel.Visible = true
        ScreenGUI.Server.Visible = true
        ServerIDNum.Text = tostring(ServerID)
        ServerName.Text = Players.LocalPlayer.Name.. " 's  SERVER"
    else
        warn("ServerID is nil")
    end
end)

JoinBTN.MouseButton1Click:Connect(function()
	while true do
		task.wait()
		local ServerID = JoinTextBox.Text
		if ServerID then
			game.ReplicatedStorage.JoinServer:FireServer(ServerID)
		else
			warn("ServerID is nil")
		end
	end

   
end)

Why on earth would you have a while loop? Do a submit/Enter button. See when the text box is no longer focus(they click away/press enter), see when the text is updated. It really seems like you are attempting to code something far beyond your limits and I would recommend aiming for something a lot simpler. It takes a lot of time to learn coding, and matchmaking systems will have an excessive amount of checks you will need to work well, especially for cross server stuff.

From what i can see, you arent attempting to teleport players at all? I would recommend learning more about teleporting players and teleport service by clicking here.

Because you can’t test teletransportation in studio ,i read the roblox create and i thought if i TP to random games in Studio ,i could steal assets

Use that id as a reserved server code for the game.