Advertisement
plytalent

backstab

Nov 30th, 2020
802
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.21 KB | None | 0 0
  1. local plr = game:GetService("Players").LocalPlayer
  2. local mouse = plr:GetMouse()
  3. local character = plr.Character
  4. local act=true
  5. mouse.KeyDown:Connect(function(k)
  6. if k == "l" then
  7. act = not act
  8. print(act)
  9. end
  10. end)
  11. mouse.Button1Down:Connect(function()
  12.     if not act then return end
  13.     curpos=plr.Character.HumanoidRootPart.CFrame
  14.     local target = nil
  15.     count = 1
  16.     curhp = 0
  17.     ne = math.huge
  18.     if math.random(1,10) == 10 then
  19.     for _,v in pairs(game:GetService("Players"):GetPlayers()) do
  20.         if v.Name ~= game:GetService("Players").LocalPlayer.Name then
  21.             if v.Character:FindFirstChild("HumanoidRootPart") then
  22.                 targetposition = v.Character:FindFirstChild("HumanoidRootPart").Position
  23.                 if (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude < 10 then
  24.                     if ne > (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude then
  25.                         ne = (game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude
  26.                         curhp = v.Character:FindFirstChildOfClass("Humanoid").Health
  27.                         warn(v.Name,"\nPosition:",targetposition,"\nMagnitude: ",(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position - targetposition).Magnitude)
  28.                         target = v
  29.                     else
  30.                         print("NE < New NE")
  31.                     end
  32.                 end
  33.             end
  34.         end
  35.     end
  36.     end
  37.     if target then
  38.         character.HumanoidRootPart.CFrame = target.Character:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(target.Character.Head.CFrame.LookVector)
  39.         character.HumanoidRootPart.Velocity = Vector3.new(character.HumanoidRootPart.Velocity.X,character.HumanoidRootPart.Velocity.Y*-1,character.HumanoidRootPart.Velocity.Z)
  40.         wait()
  41.         if curhp > target.Character:FindFirstChildOfClass("Humanoid").Health then
  42.             character.HumanoidRootPart.CFrame=curpos
  43.         else
  44.             print([[CURHP <  target.Character:FindFirstChildOfClass("Humanoid").Healt]])
  45.         end
  46.     end
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement