Advertisement
MaxproGlitcher

TweenService TP code

Mar 16th, 2023
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. game:GetService("StarterGui"):SetCore("SendNotification",{
  2. Title = "TweenService TP",
  3. Text = "Script a ÊtÊ executer",
  4. Icon = "rbxassetid://11823384169",
  5. Duration = 15
  6. })
  7.  
  8. local speed = 100 -- set this lower to make it slower
  9. local bodyvelocityenabled = true -- set this to false if you are getting kicked
  10.  
  11. local Imput = game:GetService("UserInputService")
  12. local Plr = game.Players.LocalPlayer
  13. local Mouse = Plr:GetMouse()
  14.  
  15. function To(position)
  16. local Chr = Plr.Character
  17. if Chr ~= nil then
  18. local ts = game:GetService("TweenService")
  19. local char = game.Players.LocalPlayer.Character
  20. local hm = char.HumanoidRootPart
  21. local dist = (hm.Position - Mouse.Hit.p).magnitude
  22. local tweenspeed = dist/tonumber(speed)
  23. local ti = TweenInfo.new(tonumber(tweenspeed), Enum.EasingStyle.Linear)
  24. local tp = {CFrame = CFrame.new(position)}
  25. ts:Create(hm, ti, tp):Play()
  26. if bodyvelocityenabled == true then
  27. local bv = Instance.new("BodyVelocity")
  28. bv.Parent = hm
  29. bv.MaxForce = Vector3.new(100000,100000,100000)
  30. bv.Velocity = Vector3.new(0,0,0)
  31. wait(tonumber(tweenspeed))
  32. bv:Destroy()
  33. end
  34. end
  35. end
  36.  
  37. Imput.InputBegan:Connect(function(input)
  38. if input.UserInputType == Enum.UserInputType.MouseButton1 and Imput:IsKeyDown(Enum.KeyCode.LeftControl) then
  39. To(Mouse.Hit.p)
  40. end
  41. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement