Okay all I need to know is I want the player to teleport anywhere but it has to be less than a specific distance, lets say 50 studs how would I add that to my script? What would I use? script ----
p = game.Players.LocalPlayer
c = p.Character
mouse = p:GetMouse()
k = false
dist = 50
function Main()
if k == false and p:WaitForChild("Data").doingMove.Value == false then
k = true
local pos = mouse.Hit.p
p:WaitForChild("Data").doingMove.Value = true
c.Torso.CFrame = CFrame.new(Vector3.new(pos.x, pos.y+3, pos.z))
wait(.5)
p:WaitForChild("Data").doingMove.Value = false
wait(2)
k = false
end
end
script.Parent.Activated:connect(Main)

1 comment
Oh of course I remember someone telling something about magnitude but i probably forgot about it,thanks alot funrey.