Advertisement
rObl0xexpl0it3r

Untitled

Jan 3rd, 2025
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.66 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local LocalPlayer = Players.LocalPlayer
  4. local Camera = workspace.CurrentCamera
  5.  
  6. local ESPEnabled = false
  7. local AimbotEnabled = false
  8. local AimbotConnection -- To store the RenderStepped connection
  9.  
  10. -- Function to create a rainbow effect
  11. local function getRainbowColor(step)
  12. local hue = step % 1
  13. return Color3.fromHSV(hue, 1, 1)
  14. end
  15.  
  16. -- Function to create a box ESP for a player
  17. local function createBoxESP(player)
  18. local function addESP()
  19. if not player.Character then return end
  20. local head = player.Character:WaitForChild("Head", 5)
  21. if not head then return end
  22.  
  23. -- Check if ESP already exists
  24. if head:FindFirstChild("ESPBox") then return end
  25.  
  26. -- Create BillboardGui
  27. local billboard = Instance.new("BillboardGui")
  28. billboard.Name = "ESPBox"
  29. billboard.Parent = head
  30. billboard.Adornee = head
  31. billboard.Size = UDim2.new(4, 0, 5, 0) -- Adjust size to fit the player
  32. billboard.StudsOffset = Vector3.new(0, 2, 0) -- Adjust height above head
  33. billboard.AlwaysOnTop = true
  34.  
  35. -- Create Frame for the box
  36. local boxFrame = Instance.new("Frame")
  37. boxFrame.Parent = billboard
  38. boxFrame.Size = UDim2.new(1, 0, 1, 0)
  39. boxFrame.BackgroundTransparency = 0.8 -- Semi-transparent
  40. boxFrame.BorderSizePixel = 2
  41.  
  42. -- Rainbow effect
  43. local step = 0
  44. RunService.RenderStepped:Connect(function()
  45. if ESPEnabled and billboard.Parent then
  46. step = step + 0.01
  47. boxFrame.BackgroundColor3 = getRainbowColor(step)
  48. end
  49. end)
  50. end
  51.  
  52. -- Connect to CharacterAdded in case the character respawns
  53. player.CharacterAdded:Connect(function()
  54. addESP()
  55. end)
  56.  
  57. -- Add ESP to the current character if available
  58. addESP()
  59. end
  60.  
  61. -- Function to remove ESP when a player leaves
  62. local function removeBoxESP(player)
  63. if player.Character then
  64. local head = player.Character:FindFirstChild("Head")
  65. if head and head:FindFirstChild("ESPBox") then
  66. head.ESPBox:Destroy()
  67. end
  68. end
  69. end
  70.  
  71. -- Function to toggle ESP
  72. local function toggleESP()
  73. ESPEnabled = not ESPEnabled
  74. if ESPEnabled then
  75. for _, player in ipairs(Players:GetPlayers()) do
  76. if player ~= LocalPlayer then
  77. createBoxESP(player)
  78. end
  79. end
  80. Players.PlayerAdded:Connect(function(player)
  81. if player ~= LocalPlayer then
  82. createBoxESP(player)
  83. end
  84. end)
  85. Players.PlayerRemoving:Connect(removeBoxESP)
  86. else
  87. for _, player in ipairs(Players:GetPlayers()) do
  88. removeBoxESP(player)
  89. end
  90. end
  91. end
  92.  
  93. -- Function to get the closest player's head with team check
  94. local function getClosestPlayer()
  95. local closestPlayer = nil
  96. local shortestDistance = math.huge
  97.  
  98. for _, player in ipairs(Players:GetPlayers()) do
  99. if player ~= LocalPlayer and player.Team ~= LocalPlayer.Team and player.Character and player.Character:FindFirstChild("Head") then
  100. local head = player.Character.Head
  101. local distance = (head.Position - LocalPlayer.Character.Head.Position).Magnitude
  102. if distance < shortestDistance then
  103. shortestDistance = distance
  104. closestPlayer = head
  105. end
  106. end
  107. end
  108. return closestPlayer
  109. end
  110.  
  111. -- Function to toggle Aimbot
  112. local function toggleAimbot()
  113. AimbotEnabled = not AimbotEnabled
  114.  
  115. if AimbotEnabled then
  116. -- Connect to RenderStepped for aimbot functionality
  117. AimbotConnection = RunService.RenderStepped:Connect(function()
  118. local closestHead = getClosestPlayer()
  119. if closestHead then
  120. Camera.CFrame = CFrame.new(Camera.CFrame.Position, closestHead.Position)
  121. end
  122. end)
  123. else
  124. -- Disconnect the RenderStepped connection to stop aimbot
  125. if AimbotConnection then
  126. AimbotConnection:Disconnect()
  127. AimbotConnection = nil
  128. end
  129. end
  130. end
  131.  
  132. -- Create GUI
  133. local function createGUI()
  134. local screenGui = Instance.new("ScreenGui")
  135. screenGui.Name = "ESP_Aimbot_Toggle"
  136. screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
  137.  
  138. -- ESP Button
  139. local espButton = Instance.new("TextButton")
  140. espButton.Parent = screenGui
  141. espButton.Size = UDim2.new(0, 200, 0, 50)
  142. espButton.Position = UDim2.new(0, 10, 0, 10)
  143. espButton.Text = "Toggle ESP"
  144. espButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
  145. espButton.TextScaled = true
  146. espButton.MouseButton1Click:Connect(toggleESP)
  147.  
  148. -- Aimbot Button
  149. local aimbotButton = Instance.new("TextButton")
  150. aimbotButton.Parent = screenGui
  151. aimbotButton.Size = UDim2.new(0, 200, 0, 50)
  152. aimbotButton.Position = UDim2.new(0, 10, 0, 70)
  153. aimbotButton.Text = "Toggle Aimbot"
  154. aimbotButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  155. aimbotButton.TextScaled = true
  156. aimbotButton.MouseButton1Click:Connect(toggleAimbot)
  157.  
  158. -- Super ESP Text
  159. local superText = Instance.new("TextLabel")
  160. superText.Parent = screenGui
  161. superText.Size = UDim2.new(0, 300, 0, 50)
  162. superText.Position = UDim2.new(0, 10, 0, 130)
  163. superText.Text = "Super ESP by ilovedeltax666"
  164. superText.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  165. superText.TextColor3 = Color3.fromRGB(255, 255, 255)
  166. superText.TextScaled = true
  167. superText.BorderSizePixel = 0
  168. end
  169.  
  170. -- Initialize GUI
  171. createGUI()
  172.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement