Advertisement
dthgdth

oigjhfuy

Apr 8th, 2020
1,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. function teleport(destination_cframe)
  3.     local Character = Player.Character
  4.     local Humanoid = Character.Humanoid
  5.     local can_collide = {}
  6.     local connection = Character.Torso.Touched:connect(function(t)
  7.         if t.CanCollide == true then
  8.             t.CanCollide = false
  9.             table.insert(can_collide, t)
  10.         end
  11.     end)
  12.     local thrust = Instance.new("BodyPosition", Character.Torso)
  13.     thrust.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  14.     thrust.Position = destination_cframe.p
  15.     thrust.P = 150000
  16.     repeat wait() until (Character.Torso.CFrame.p - destination_cframe.p).magnitude < 10
  17.     thrust:Destroy()
  18.     connection:Disconnect()
  19.     for i, v in pairs(can_collide) do
  20.         v.CanCollide = true
  21.     end
  22.     local no_movement = Vector3.new(0,0,0)
  23.     repeat wait()
  24.         Character.HumanoidRootPart.Velocity = no_movement
  25.         Humanoid:ChangeState(11)
  26.     until Character.Torso.Velocity == no_movement
  27.     for i = 1,5 do
  28.         Character.HumanoidRootPart.CFrame = destination_cframe
  29.     end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement