SigmaBoy456

Roblox realistic tank simulator FE kill all script

Aug 2nd, 2024 (edited)
324
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. -- Reminder: Join a Team and select Class and Always Equip Gun To make Script Work(Actually you don't need to Equip Gun the Script alway Work anyway but if Script doesn't work just equip)
  2. while true do
  3. local player = game.Players.LocalPlayer
  4. local character = player.Character or player.CharacterAdded:Wait()
  5. local localroot = character:WaitForChild("HumanoidRootPart")
  6.  
  7. local function closestEnemy()
  8. local range = math.huge
  9. local target = nil
  10. for _, v in pairs(game.Players:GetPlayers()) do
  11. if v ~= player and v.Team ~= player.Team and v.Character then
  12. local enemyRoot = v.Character:FindFirstChild("HumanoidRootPart")
  13. if enemyRoot then
  14. local distance = (localroot.Position - enemyRoot.Position).magnitude
  15. if distance < range then
  16. range = distance
  17. target = v
  18. end
  19. end
  20. end
  21. end
  22. return target
  23. end
  24.  
  25. local enemy = closestEnemy()
  26. if enemy then
  27. local enemyCharacter = enemy.Character
  28. local enemyRoot = enemyCharacter:FindFirstChild("Head")
  29. local enemyHumanoid = enemyCharacter:FindFirstChild("Humanoid")
  30. if enemyRoot and enemyHumanoid then
  31. spawn(function()
  32. while enemyHumanoid.Health > 0 do
  33. local args = {
  34. [1] = enemyHumanoid,
  35. [2] = math.huge,
  36. [3] = enemyRoot
  37. }
  38. game:GetService("ReplicatedStorage").RemoteEvents.DamageEvent:FireServer(unpack(args))
  39. wait(0.1)
  40. end
  41. end)
  42. end
  43. end
  44. wait(0.1)
  45. end
Advertisement
Comments
  • SigmaBoy456
    1 year
    # text 0.12 KB | 0 0
    1. Equip the Gun to Make Script work And here link game
    2. https://www.roblox.com/games/2292818376/Realistic-Tank-Simulator-2-0-BETA
Add Comment
Please, Sign In to add comment