Need Help on teleportation service

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    To make it so that it teleports you to the game instead of giving teleport id = 0, unavailable to teleport.
  2. What is the issue? Include screenshots / videos if possible!

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve tried changing a few scripts and still doesn’t work…

This is the script that teleports:

-- params : ...

port = game:GetService("TeleportService")
ID = game.Workspace.TargetID.Value
while wait() do
if script.Parent.Selected.Value == true then
script.Parent.Start.Touched:connect(function(player)
if player.Parent:FindFirstChild("Humanoid") and game:GetService("Players"):FindFirstChild(player.Parent.Name) then
player=game:GetService("Players"):FindFirstChild(player.Parent.Name)
port:Teleport(ID,player)
end
end)
end
end

Your problem is in game.Workspace.TargetID.Value, you get the value before it changed here is fixed version of your script

local port = game:GetService("TeleportService")
local ID = game.Workspace.TargetID

script.Parent.Selected.Changed:Connect(function()
if script.Parent.Selected.Value == true then
	script.Parent.Start.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(hit.Parent) then
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		port:Teleport(ID.Value, player)
	end
	end)
end
end)

Thank you, it worked for the teleport.