Advertisement
SigmaBoy456

roblox kill aura Copy of minecraft script

Sep 8th, 2024 (edited)
15,804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. -- Script made by Mawin_CK
  2. -- Setting
  3. local range = 30 -- set this to 10-30 (Optional)
  4. local delaytime = 0.1 -- You can Instead change wait() to other following down here
  5. --[[
  6. game:GetService("RunService").Heartbeat:Wait()
  7. or you can Use
  8. RenderStepped instead of Heartbeat
  9. ]]
  10.  
  11. -- Full Script
  12. local player = game.Players.LocalPlayer
  13. local character = player.Character
  14. local localroot = character:WaitForChild("HumanoidRootPart")
  15.  
  16. local function closest()
  17. local target = nil
  18. for i, v in pairs(game.Players:GetPlayers()) do
  19. if v ~= player and v.Character then
  20. local JN = v.Character:FindFirstChild("HumanoidRootPart")
  21. local dist = (localroot.Position - JN.Position).magnitude
  22. if dist < range then
  23. target = v.Character
  24. end
  25. end
  26. end
  27. return target
  28. end
  29.  
  30. local t = closest()
  31.  
  32. -- Update Closest
  33. game:GetService("RunService").RenderStepped:Connect(function()
  34. t = closest()
  35. end)
  36.  
  37. while wait(1) do
  38. while wait(delaytime) do
  39. local args = {
  40. [1] = t
  41. }
  42. game:GetService("ReplicatedStorage").GameRemotes.Attack:InvokeServer(unpack(args))
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement