Advertisement
SigmaBoy456

Roblox School thug Kill Aura #742

Oct 11th, 2024
430
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 1 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character
  3. local localroot = character:WaitForChild("HumanoidRootPart")
  4.  
  5. local function closest()
  6. local range = 50
  7. local target = nil
  8. for _, v in pairs(game.Players:GetPlayers()) do
  9. if v ~= player and v.Character and not v.Character:FindFirstChildWhichIsA("ForceField") then
  10. local JN = v.Character:FindFirstChild("HumanoidRootPart")
  11. local JNR = v.Character:FindFirstChildOfClass("Humanoid")
  12. if JN and JNR.Health > 3 then
  13. local dist = (localroot.Position - JN.Position).magnitude
  14. if dist < range then
  15. range = dist
  16. target = v.Character
  17. end
  18. end
  19. end
  20. end
  21. return target
  22. end
  23.  
  24. game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
  25. character = char
  26. localroot = character:WaitForChild("HumanoidRootPart")
  27. end)
  28.  
  29. local vh = closest()
  30.  
  31. game:GetService("RunService").Heartbeat:Connect(function()
  32. vh = closest()
  33. end)
  34.  
  35. while game:GetService("RunService").Heartbeat:Wait() do
  36. if vh and vh:FindFirstChild("UpperTorso") then
  37. local vroot = vh:FindFirstChild("UpperTorso")
  38. local args = {
  39. [1] = 1,
  40. [2] = vh,
  41. [3] = 50,
  42. [4] = vroot
  43. }
  44.  
  45. game:GetService("ReplicatedStorage").MainEvents.PUNCHEVENT:FireServer(unpack(args))
  46. end
  47. end
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement