Baconcoder

ULT ADMIN PANEL

Jun 29th, 2025 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local StarterGui = game:GetService("StarterGui")
  5.  
  6. local LocalPlayer = Players.LocalPlayer
  7.  
  8. local ESPColorPlayers = Color3.fromRGB(0, 255, 0)
  9. local ESPColorModels = Color3.fromRGB(255, 0, 0)
  10.  
  11. local ESPSelectionBoxes = {}
  12. local ESPModelsList = {}
  13.  
  14. local espEnabled = false
  15.  
  16. -- Create toggle button GUI
  17. local screenGui = Instance.new("ScreenGui")
  18. screenGui.Name = "ESP_Toggle_GUI"
  19. screenGui.ResetOnSpawn = false
  20. screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
  21.  
  22. local toggleButton = Instance.new("TextButton")
  23. toggleButton.Size = UDim2.new(0, 120, 0, 40)
  24. toggleButton.Position = UDim2.new(0, 10, 0, 10)
  25. toggleButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  26. toggleButton.TextColor3 = Color3.new(1,1,1)
  27. toggleButton.Text = "ESP: OFF"
  28. toggleButton.Font = Enum.Font.SourceSansBold
  29. toggleButton.TextScaled = true
  30. toggleButton.Parent = screenGui
  31.  
  32. -- Helper: Create SelectionBox on a part with given color
  33. local function createSelectionBox(part, color)
  34. local box = Instance.new("SelectionBox")
  35. box.Adornee = part
  36. box.Color3 = color
  37. box.LineThickness = 0.05
  38. box.SurfaceTransparency = 0.9
  39. box.Parent = part
  40. return box
  41. end
  42.  
  43. local function addESPToModel(model, color)
  44. if ESPSelectionBoxes[model] then return end
  45. ESPSelectionBoxes[model] = {}
  46.  
  47. for _, part in ipairs(model:GetDescendants()) do
  48. if part:IsA("BasePart") then
  49. local box = createSelectionBox(part, color)
  50. ESPSelectionBoxes[model][part] = box
  51. end
  52. end
  53. end
  54.  
  55. local function removeESPFromModel(model)
  56. if not ESPSelectionBoxes[model] then return end
  57. for _, box in pairs(ESPSelectionBoxes[model]) do
  58. box:Destroy()
  59. end
  60. ESPSelectionBoxes[model] = nil
  61. end
  62.  
  63. local function cleanupESP()
  64. for model, _ in pairs(ESPSelectionBoxes) do
  65. if not model.Parent then
  66. removeESPFromModel(model)
  67. ESPModelsList[model] = nil
  68. end
  69. end
  70. end
  71.  
  72. local function teleportToModel(model)
  73. local character = LocalPlayer.Character
  74. if not character then return end
  75. local hrp = character:FindFirstChild("HumanoidRootPart")
  76. if not hrp then return end
  77.  
  78. local targetPart = model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart")
  79. if targetPart then
  80. hrp.CFrame = targetPart.CFrame + Vector3.new(0, 5, 0)
  81. end
  82. end
  83.  
  84. local function updateESP()
  85. if not espEnabled then return end
  86.  
  87. -- Players
  88. for _, player in pairs(Players:GetPlayers()) do
  89. if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  90. local model = player.Character
  91. if not ESPSelectionBoxes[model] then
  92. addESPToModel(model, ESPColorPlayers)
  93. ESPModelsList[model] = true
  94. end
  95. end
  96. end
  97.  
  98. -- Other models
  99. for _, obj in pairs(workspace:GetChildren()) do
  100. if obj:IsA("Model") and not Players:GetPlayerFromCharacter(obj) then
  101. if not ESPSelectionBoxes[obj] then
  102. addESPToModel(obj, ESPColorModels)
  103. ESPModelsList[obj] = true
  104. end
  105. end
  106. end
  107. end
  108.  
  109. -- Toggle ESP on/off with button
  110. toggleButton.MouseButton1Click:Connect(function()
  111. espEnabled = not espEnabled
  112. toggleButton.Text = espEnabled and "ESP: ON" or "ESP: OFF"
  113.  
  114. if not espEnabled then
  115. -- Remove all SelectionBoxes
  116. for model, _ in pairs(ESPSelectionBoxes) do
  117. removeESPFromModel(model)
  118. ESPModelsList[model] = nil
  119. end
  120. end
  121. end)
  122.  
  123. -- Detect click to teleport
  124. local mouse = LocalPlayer:GetMouse()
  125. mouse.Button1Down:Connect(function()
  126. if not espEnabled then return end
  127. local target = mouse.Target
  128. if not target then return end
  129.  
  130. for model, parts in pairs(ESPSelectionBoxes) do
  131. if parts[target] then
  132. teleportToModel(model)
  133. break
  134. end
  135. end
  136. end)
  137.  
  138. -- Update loop every 0.5 seconds for performance on mobile
  139. local timeSinceUpdate = 0
  140. RunService.RenderStepped:Connect(function(dt)
  141. timeSinceUpdate = timeSinceUpdate + dt
  142. if timeSinceUpdate >= 0.5 then
  143. updateESP()
  144. cleanupESP()
  145. timeSinceUpdate = 0
  146. end
  147. end)
  148.  
Advertisement
Add Comment
Please, Sign In to add comment