Advertisement
idontpostcracks

fling

Jun 13th, 2022
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.69 KB | None | 0 0
  1. local lp = game.Players.LocalPlayer
  2. for i,v in pairs(game.Players:GetPlayers()) do
  3.     if v.Name:lower():match("^"..Target:lower()) or v.DisplayName:lower():match("^"..Target:lower()) then
  4.         Target = v
  5.         break
  6.     end
  7. end
  8.  
  9. if type(Target) == "string" then return end
  10.  
  11. local oldpos = lp.Character.HumanoidRootPart.CFrame
  12. local oldhh = lp.Character.Humanoid.HipHeight
  13.  
  14. local carpetAnim = Instance.new("Animation")
  15. carpetAnim.AnimationId = "rbxassetid://282574440"
  16. carpet = lp.Character:FindFirstChildOfClass('Humanoid'):LoadAnimation(carpetAnim)
  17. carpet:Play(.1, 1, 1)
  18.  
  19. local carpetLoop
  20.  
  21. local tTorso = Target.Character:FindFirstChild("Torso") or Target.Character:FindFirstChild("LowerTorso") or Target.Character:FindFirstChild("HumanoidRootPart")
  22.  
  23. spawn(function()
  24.     carpetLoop = game:GetService('RunService').Heartbeat:Connect(function()
  25.         pcall(function()
  26.             if tTorso.Velocity.magnitude <= 28 then -- if target uses netless just target their local position
  27.                 local pos = {x=0, y=0, z=0}
  28.                 pos.x = tTorso.Position.X
  29.                 pos.y = tTorso.Position.Y
  30.                 pos.z = tTorso.Position.Z
  31.                 pos.x = pos.x + tTorso.Velocity.X / 2
  32.                 pos.y = pos.y + tTorso.Velocity.Y / 2
  33.                 pos.z = pos.z + tTorso.Velocity.Z / 2
  34.                 lp.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(pos.x,pos.y,pos.z))
  35.             else
  36.                 lp.Character.HumanoidRootPart.CFrame = tTorso.CFrame
  37.             end
  38.         end)
  39.     end)
  40. end)
  41.  
  42. wait()
  43.  
  44. lp.Character.Humanoid.HipHeight = flinghh
  45.  
  46. wait(.5)
  47.  
  48. carpetLoop:Disconnect()
  49. wait()
  50. lp.Character.Humanoid.Health = 0
  51. wait(game.Players.RespawnTime + .6)
  52. lp.Character.HumanoidRootPart.CFrame = oldpos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement