Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[local Plr = game:GetService("Players").LocalPlayer
- local Mouse = Plr:GetMouse()
- Mouse.Button1Down:connect(function()
- if not game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then return end
- if not Mouse.Target then return end
- Plr.Character:MoveTo(Mouse.Hit.p)
- end)
- --]]
- game:GetService("StarterGui"):SetCore("SendNotification",{
- Title = "CTRL click tp",
- Text = "Hold Ctrl then press click to a place you want to teleport to.",
- Duration = 6,
- })
- local speed = 100 -- set this lower to make it slower
- local bodyvelocityenabled = true -- set this to false if you are getting kicked
- local Imput = game:GetService("UserInputService")
- local Plr = game.Players.LocalPlayer
- local Mouse = Plr:GetMouse()
- function To(position)
- local Chr = Plr.Character
- if Chr ~= nil then
- local ts = game:GetService("TweenService")
- local char = game.Players.LocalPlayer.Character
- local hm = char.HumanoidRootPart
- local dist = (hm.Position - Mouse.Hit.p).magnitude
- local tweenspeed = dist/tonumber(speed)
- local ti = TweenInfo.new(tonumber(tweenspeed), Enum.EasingStyle.Linear)
- local tp = {CFrame = CFrame.new(position)}
- ts:Create(hm, ti, tp):Play()
- if bodyvelocityenabled == true then
- local bv = Instance.new("BodyVelocity")
- bv.Parent = hm
- bv.MaxForce = Vector3.new(100000,100000,100000)
- bv.Velocity = Vector3.new(0,0,0)
- wait(tonumber(tweenspeed))
- bv:Destroy()
- end
- end
- end
- Imput.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 and Imput:IsKeyDown(Enum.KeyCode.LeftControl) then
- To(Mouse.Hit.p)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement