Advertisement
plytalent

something

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