Im trying to make a script that teleports a player at a limited distance, but my script is not working very well. I am completely baffled on how to go about making a limit distance that the player can go ;-;

tool = script.Parent.Parent.Parent
player = tool.Parent.Parent
limit = 15
mouse = player:GetMouse()
Dash.OnServerEvent:connect(function(player, mousehit)
    local torso = player.Character:findFirstChild("UpperTorso")
torso.CFrame = CFrame.new(Vector3.new(mousehit))

end)