local mouse = script.Parent.Parent:GetMouse()
game:GetService('UserInputService').InputBegan:connect(function(input, gameprossed)
if input.KeyCode == Enum.KeyCode.V and not gameprossed then
script.Parent.Parent.Character.Torso.CFrame = CFrame.new(mouse.hit.p)
end
end)
how do i set a limit on this teleport script? so it doesnt allow players to teleport to far btw this is a local script

1 comment
i looked at this for 2 secs so just an idea: make a variable for the cframe where the mouse hit, lets say "local placeClicked" then do an if statement checking if the distance between the persons cframe and the placeClicked exceeds a distance(the limit), etc... Also add a debounce so players can't spam or whatever.