How to make teleport ability with limit ranged?

Today i have a question.

How to make a teleport ability with limit ranged ?

Like the limited ranged is 100
if player tried to teleport out of range
then player will be teleported to max range they can teleport,
but if they tried to teleport inside the range then teleport to there.

Sorry for bad english.
Thanks in advance.


1 Like