Help with surface teleport script

So right now i have to hover over a screen gui and click on it so i can teleport to the surface. Any idea how i can convert it to so i can just press a button?

local plr = game.Players.LocalPlayer
local char = plr.Character
repeat wait() until char ~= nil

script.Parent.Surface.MouseButton1Click:Connect(function()
	local closestDistance = math.huge
	local closestSurface = nil
	for _, zone in next, workspace.Map.Zones:GetChildren() do
		local surface = zone.Surface
		if (char.UpperTorso.Position - surface.Position).Magnitude < closestDistance then
			closestDistance = (char.UpperTorso.Position - surface.Position).Magnitude
			closestSurface = surface
		end
	end
	char.UpperTorso.CFrame = closestSurface.CFrame
end)

For more clarifying, do you mean button like keyboard keys? Or a TextButton / ImageButton?

Yeah buttons on a keyboard. I just need to be able to press a button on the keyboard to teleport

local UIS = game:GetService("UserInputService")

local function Teleport()
   -- teleport code here
end

UIS.InputBegan:Connect(function(Input,GPE)
   if GPE then return end

   if Input.Keycode == Enum.Keycode.E then -- You can change the keybind to something else of you want.
      Teleport()
   end
end)

Also, don’t set a body part CFrame, instead set the CFrame of the HumanoidRootPart