Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- function teleport(destination_cframe)
- local Character = Player.Character
- local Humanoid = Character.Humanoid
- local can_collide = {}
- local connection = Character.Torso.Touched:connect(function(t)
- if t.CanCollide == true then
- t.CanCollide = false
- table.insert(can_collide, t)
- end
- end)
- local thrust = Instance.new("BodyPosition", Character.Torso)
- thrust.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- thrust.Position = destination_cframe.p
- thrust.P = 150000
- repeat wait() until (Character.Torso.CFrame.p - destination_cframe.p).magnitude < 10
- thrust:Destroy()
- connection:Disconnect()
- for i, v in pairs(can_collide) do
- v.CanCollide = true
- end
- local no_movement = Vector3.new(0,0,0)
- repeat wait()
- Character.HumanoidRootPart.Velocity = no_movement
- Humanoid:ChangeState(11)
- until Character.Torso.Velocity == no_movement
- for i = 1,5 do
- Character.HumanoidRootPart.CFrame = destination_cframe
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement