local p=game.Players.LocalPlayer
local char=p.Character
local root=char:WaitForChild('HumanoidRootPart')
local mouse=p:GetMouse()
function tele()
char.Humanoid:MoveTo(mouse.Hit.p)
end
mouse.Button1Down:Connect(function()
tele()
end)
the script above would allow the player to teleport anywhere on the map without limitations. is there any way for it to not activate if the distance is farther than 100 studs?

2 comments
Humanoid MoveTo makes the character walk to a location, not teleport.
why don't you just use mouse.Button1Down(tele)