probanana

FRONTLIENS SCRIPT

Mar 10th, 2023
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. -- Set hitbox size, transparency level, and notification status
  2. local size = Vector3.new(10, 10, 10)
  3. local trans = 1
  4. local notifications = false
  5.  
  6. -- Store the time when the code starts executing
  7. local start = os.clock()
  8.  
  9. -- Send a notification saying that the script is loading
  10. game.StarterGui:SetCore("SendNotification", {
  11. Title = "Script",
  12. Text = "Loading script...",
  13. Icon = "",
  14. Duration = 5
  15. })
  16.  
  17. -- Load the ESP library and turn it on
  18. local esp = loadstring(game:HttpGet("https://raw.githubusercontent.com/andrewc0de/Roblox/main/Dependencies/ESP.lua"))()
  19. esp:Toggle(true)
  20.  
  21. -- Configure ESP settings
  22. esp.Boxes = true
  23. esp.Names = false
  24. esp.Tracers = false
  25. esp.Players = false
  26.  
  27. -- Add an object listener to the workspace to detect enemy models
  28. esp:AddObjectListener(workspace, {
  29. Name = "soldier_model",
  30. Type = "Model",
  31. Color = Color3.fromRGB(255, 0, 4),
  32.  
  33. -- Specify the primary part of the model as the HumanoidRootPart
  34. PrimaryPart = function(obj)
  35. local root
  36. repeat
  37. root = obj:FindFirstChild("HumanoidRootPart")
  38. task.wait()
  39. until root
  40. return root
  41. end,
  42.  
  43. -- Use a validator function to ensure that models do not have the "friendly_marker" child
  44. Validator = function(obj)
  45. task.wait(1)
  46. if obj:FindFirstChild("friendly_marker") then
  47. return false
  48. end
  49. return true
  50. end,
  51.  
  52. -- Set a custom name to use for the enemy models
  53. CustomName = "?",
  54.  
  55. -- Enable the ESP for enemy models
  56. IsEnabled = "enemy"
  57. })
  58.  
  59. -- Enable the ESP for enemy models
  60. esp.enemy = true
  61.  
  62. -- Wait for the game to load fully before applying hitboxes
  63. task.wait(1)
  64.  
  65. -- Apply hitboxes to all existing enemy models in the workspace
  66. for _, v in pairs(workspace:GetDescendants()) do
  67. if v.Name == "soldier_model" and v:IsA("Model") and not v:FindFirstChild("friendly_marker") then
  68. local pos = v:FindFirstChild("HumanoidRootPart").Position
  69. for _, bp in pairs(workspace:GetChildren()) do
  70. if bp:IsA("BasePart") then
  71. local distance = (bp.Position - pos).Magnitude
  72. if distance <= 5 then
  73. bp.Transparency = trans
  74. bp.Size = size
  75. end
  76. end
  77. end
  78. end
  79. end
  80.  
  81. -- Function to handle when a new descendant is added to the workspace
  82. local function handleDescendantAdded(descendant)
  83. task.wait(1)
  84.  
  85. -- If the new descendant is an enemy model and notifications are enabled, send a notification
  86. if descendant.Name == "soldier_model" and descendant:IsA("Model") and not descendant:FindFirstChild("friendly_marker") then
  87. if notifications then
  88. game.StarterGui:SetCore("SendNotification", {
  89. Title = "Script",
  90. Text = "[Warning] New Enemy Spawned! Applied hitboxes.",
  91. Icon = "",
  92. Duration = 3
  93. })
  94. end
  95.  
  96. -- Apply hitboxes to the new enemy model
  97. local pos = descendant:FindFirstChild("HumanoidRootPart").Position
  98. for _, bp in pairs(workspace:GetChildren()) do
  99. if bp:IsA("BasePart") then
  100. local distance = (bp.Position - pos).Magnitude
  101. if distance <= 5 then
  102. bp.Transparency = trans
  103. bp.Size = size
  104. end
  105. end
  106. end
  107. end
  108. end
  109.  
  110. -- Connect the handleDescendantAdded function to the DescendantAdded event of the workspace
  111. task.spawn(function()
  112. game.Workspace.DescendantAdded:Connect(handleDescendantAdded)
  113. end)
  114.  
  115. -- Store the time when the code finishes executing
  116. local finish = os.clock()
  117.  
  118. -- Calculate how long the code took to run and determine a rating for the loading speed
  119. local time = finish - start
  120. local rating
  121. if time < 3 then
  122. rating = "fast"
  123. elseif time < 5 then
  124. rating = "acceptable"
  125. else
  126. rating = "slow"
  127. end
  128.  
  129. -- Send a notification showing how long the code took to run and its rating
  130. game.StarterGui:SetCore("SendNotification", {
  131. Title = "Script",
  132. Text = string.format("Script loaded in %.2f seconds (%s loading)", time, rating),
  133. Icon = "",
  134. Duration = 5
  135. })
Add Comment
Please, Sign In to add comment