Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Servicios
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local SoundService = game:GetService("SoundService")
- -- Variables globales y configuraciones
- local Config = {
- BoxESP = false,
- HealthESP = false,
- NameESP = false,
- TracerESP = false,
- DistanceESP = false,
- HighlightESP = false,
- PerseguirUsuario = false,
- PerseguirIgnorando = false,
- FOLLOW_DISTANCE = 6,
- PREDICTION_TIME = 0.3,
- BoxESPColor = Color3.fromRGB(255, 0, 0),
- HealthESPColor = Color3.fromRGB(0, 255, 0),
- NameESPColor = Color3.fromRGB(255, 255, 255),
- TracerESPColor = Color3.fromRGB(255, 255, 0),
- DistanceESPColor = Color3.fromRGB(255, 255, 255),
- HighlightFillColor = Color3.fromRGB(255, 0, 0),
- HighlightOutlineColor = Color3.fromRGB(0, 0, 0),
- PerseguirHighlightColor = Color3.fromRGB(0, 255, 0),
- BoxESPOpacity = 1,
- HealthESPOpacity = 1,
- NameESPOpacity = 1,
- TracerESPOpacity = 1,
- DistanceESPOpacity = 1,
- HighlightESPOpacity = 0.5,
- UIOpacity = 0.9,
- ButtonOpacity = 1
- }
- -- Paleta de colores predefinidos
- local ColorPalette = {
- Color3.fromRGB(255, 0, 0),
- Color3.fromRGB(0, 255, 0),
- Color3.fromRGB(0, 0, 255),
- Color3.fromRGB(255, 255, 0),
- Color3.fromRGB(255, 0, 255),
- Color3.fromRGB(0, 255, 255),
- Color3.fromRGB(255, 255, 255),
- Color3.fromRGB(0, 0, 0)
- }
- -- Sonidos
- local function CreateSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.Volume = 0.5
- sound.Parent = SoundService
- return sound
- end
- local toggleSound = CreateSound("rbxassetid://6895079853")
- local buttonClickSound = CreateSound("rbxassetid://6895079733")
- local valueChangeSound = CreateSound("rbxassetid://6895079981")
- local openMenuSound = CreateSound("rbxassetid://6895079981")
- local closeMenuSound = CreateSound("rbxassetid://6895079981")
- local changeSectionSound = CreateSound("rbxassetid://6895079981")
- -- Crear la interfaz de usuario personalizada
- local PlayerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "CustomESPGUI"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- ScreenGui.Parent = PlayerGui
- -- Botón circular principal
- local CircleButton = Instance.new("ImageButton")
- CircleButton.Size = UDim2.new(0, 50, 0, 50)
- CircleButton.Position = UDim2.new(0, 20, 0.5, -25)
- CircleButton.AnchorPoint = Vector2.new(0, 0.5)
- CircleButton.Image = "rbxassetid://3926305904"
- CircleButton.ImageRectOffset = Vector2.new(204, 844)
- CircleButton.ImageRectSize = Vector2.new(36, 36)
- CircleButton.BackgroundTransparency = 1
- CircleButton.Parent = ScreenGui
- -- Botón circular para activar/desactivar Perseguir
- local PerseguirToggleButton = Instance.new("ImageButton")
- PerseguirToggleButton.Size = UDim2.new(0, 40, 0, 40)
- PerseguirToggleButton.Position = UDim2.new(0, 20, 1, -20)
- PerseguirToggleButton.AnchorPoint = Vector2.new(0, 1)
- PerseguirToggleButton.Image = "rbxassetid://3926305904"
- PerseguirToggleButton.ImageRectOffset = Vector2.new(924, 724)
- PerseguirToggleButton.ImageRectSize = Vector2.new(36, 36)
- PerseguirToggleButton.BackgroundTransparency = 1
- PerseguirToggleButton.Visible = false
- PerseguirToggleButton.Parent = ScreenGui
- -- Panel principal
- local MainPanel = Instance.new("Frame")
- MainPanel.Size = UDim2.new(0, 300, 0, 400)
- MainPanel.Position = UDim2.new(0.5, 0, 0.5, 0)
- MainPanel.AnchorPoint = Vector2.new(0.5, 0.5)
- MainPanel.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- MainPanel.BackgroundTransparency = 1 - Config.UIOpacity
- MainPanel.BorderSizePixel = 0
- MainPanel.Visible = false
- MainPanel.Parent = ScreenGui
- -- Efecto de sombra
- local Shadow = Instance.new("ImageLabel")
- Shadow.Size = UDim2.new(1, 20, 1, 20)
- Shadow.Position = UDim2.new(0.5, 0, 0.5, 0)
- Shadow.AnchorPoint = Vector2.new(0.5, 0.5)
- Shadow.BackgroundTransparency = 1
- Shadow.Image = "rbxassetid://1316045217"
- Shadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
- Shadow.ImageTransparency = 0.8
- Shadow.ScaleType = Enum.ScaleType.Slice
- Shadow.SliceCenter = Rect.new(10, 10, 118, 118)
- Shadow.Parent = MainPanel
- -- Título del panel
- local TitleLabel = Instance.new("TextLabel")
- TitleLabel.Size = UDim2.new(1, 0, 0, 40)
- TitleLabel.Text = "ESP Universal Personalizado"
- TitleLabel.TextColor3 = Color3.new(1, 1, 1)
- TitleLabel.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- TitleLabel.BorderSizePixel = 0
- TitleLabel.Font = Enum.Font.GothamBold
- TitleLabel.TextSize = 18
- TitleLabel.Parent = MainPanel
- -- Botones de sección
- local ESPButton = Instance.new("TextButton")
- ESPButton.Size = UDim2.new(0.33, -5, 0, 30)
- ESPButton.Position = UDim2.new(0, 5, 0, 45)
- ESPButton.Text = "ESP"
- ESPButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- ESPButton.TextColor3 = Color3.new(1, 1, 1)
- ESPButton.Font = Enum.Font.GothamSemibold
- ESPButton.TextSize = 14
- ESPButton.BorderSizePixel = 0
- ESPButton.Parent = MainPanel
- local PerseguirButton = Instance.new("TextButton")
- PerseguirButton.Size = UDim2.new(0.33, -5, 0, 30)
- PerseguirButton.Position = UDim2.new(0.33, 5, 0, 45)
- PerseguirButton.Text = "Perseguir"
- PerseguirButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- PerseguirButton.TextColor3 = Color3.new(1, 1, 1)
- PerseguirButton.Font = Enum.Font.GothamSemibold
- PerseguirButton.TextSize = 14
- PerseguirButton.BorderSizePixel = 0
- PerseguirButton.Parent = MainPanel
- local OtrosButton = Instance.new("TextButton")
- OtrosButton.Size = UDim2.new(0.33, -5, 0, 30)
- OtrosButton.Position = UDim2.new(0.66, 5, 0, 45)
- OtrosButton.Text = "Otros"
- OtrosButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- OtrosButton.TextColor3 = Color3.new(1, 1, 1)
- OtrosButton.Font = Enum.Font.GothamSemibold
- OtrosButton.TextSize = 14
- OtrosButton.BorderSizePixel = 0
- OtrosButton.Parent = MainPanel
- -- Frames de sección
- local ESPFrame = Instance.new("ScrollingFrame")
- ESPFrame.Size = UDim2.new(1, -20, 1, -90)
- ESPFrame.Position = UDim2.new(0, 10, 0, 80)
- ESPFrame.BackgroundTransparency = 1
- ESPFrame.ScrollBarThickness = 6
- ESPFrame.Visible = true
- ESPFrame.Parent = MainPanel
- local PerseguirFrame = Instance.new("Frame")
- PerseguirFrame.Size = UDim2.new(1, -20, 1, -90)
- PerseguirFrame.Position = UDim2.new(0, 10, 0, 80)
- PerseguirFrame.BackgroundTransparency = 1
- PerseguirFrame.Visible = false
- PerseguirFrame.Parent = MainPanel
- local OtrosFrame = Instance.new("ScrollingFrame")
- OtrosFrame.Size = UDim2.new(1, -20, 1, -90)
- OtrosFrame.Position = UDim2.new(0, 10, 0, 80)
- OtrosFrame.BackgroundTransparency = 1
- OtrosFrame.ScrollBarThickness = 6
- OtrosFrame.Visible = false
- OtrosFrame.Parent = MainPanel
- -- Función para crear la paleta de colores
- local function CreateColorPalette(parent, callback)
- local ColorPaletteFrame = Instance.new("Frame")
- ColorPaletteFrame.Name = "ColorPalette"
- ColorPaletteFrame.Size = UDim2.new(0, 200, 0, 100)
- ColorPaletteFrame.Position = UDim2.new(0.5, -100, 0.5, -50)
- ColorPaletteFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- ColorPaletteFrame.BorderSizePixel = 0
- ColorPaletteFrame.Visible = false
- ColorPaletteFrame.Parent = parent
- for i, color in ipairs(ColorPalette) do
- local ColorButton = Instance.new("TextButton")
- ColorButton.Size = UDim2.new(0.25, -5, 0.5, -5)
- ColorButton.Position = UDim2.new(0.25 * ((i-1) % 4), 5, 0.5 * math.floor((i-1) / 4), 5)
- ColorButton.BackgroundColor3 = color
- ColorButton.Text = ""
- ColorButton.Parent = ColorPaletteFrame
- ColorButton.MouseButton1Click:Connect(function()
- buttonClickSound:Play()
- callback(color)
- ColorPaletteFrame.Visible = false
- end)
- end
- return ColorPaletteFrame
- end
- -- Función para crear un toggle
- local function CreateToggle(parent, name, icon, callback, colorCallback)
- local ToggleFrame = Instance.new("Frame")
- ToggleFrame.Size = UDim2.new(1, 0, 0, 30)
- ToggleFrame.BackgroundTransparency = 1
- ToggleFrame.Parent = parent
- local IconImage = Instance.new("ImageLabel")
- IconImage.Size = UDim2.new(0, 20, 0, 20)
- IconImage.Position = UDim2.new(0, 5, 0, 5)
- IconImage.Image = icon
- IconImage.BackgroundTransparency = 1
- IconImage.Parent = ToggleFrame
- local NameLabel = Instance.new("TextLabel")
- NameLabel.Size = UDim2.new(1, -110, 1, 0)
- NameLabel.Position = UDim2.new(0, 30, 0, 0)
- NameLabel.Text = name
- NameLabel.TextColor3 = Color3.new(1, 1, 1)
- NameLabel.TextXAlignment = Enum.TextXAlignment.Left
- NameLabel.BackgroundTransparency = 1
- NameLabel.Font = Enum.Font.Gotham
- NameLabel.TextSize = 14
- NameLabel.Parent = ToggleFrame
- local ToggleButton = Instance.new("TextButton")
- ToggleButton.Size = UDim2.new(0, 40, 0, 20)
- ToggleButton.Position = UDim2.new(1, -45, 0, 5)
- ToggleButton.Text = ""
- ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Inicialmente rojo (desactivado)
- ToggleButton.BorderSizePixel = 0
- ToggleButton.Parent = ToggleFrame
- local ToggleIndicator = Instance.new("Frame")
- ToggleIndicator.Size = UDim2.new(0, 16, 0, 16)
- ToggleIndicator.Position = UDim2.new(0, 2, 0, 2)
- ToggleIndicator.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ToggleIndicator.BorderSizePixel = 0
- ToggleIndicator.Parent = ToggleButton
- local isToggled = false
- ToggleButton.MouseButton1Click:Connect(function()
- toggleSound:Play()
- isToggled = not isToggled
- local targetPosition = isToggled and UDim2.new(1, -18, 0, 2) or UDim2.new(0, 2, 0, 2)
- local targetColor = isToggled and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
- TweenService:Create(ToggleIndicator, TweenInfo.new(0.2), {Position = targetPosition}):Play()
- TweenService:Create(ToggleButton, TweenInfo.new(0.2), {BackgroundColor3 = targetColor}):Play()
- callback(isToggled)
- -- Update PerseguirToggleButton visibility
- if name == "Perseguir Usuario" or name == "Perseguir Ignorando" then
- PerseguirToggleButton.Visible = Config.PerseguirUsuario or Config.PerseguirIgnorando
- if PerseguirToggleButton.Visible then
- PerseguirToggleButton.ImageColor3 = Color3.fromRGB(0, 255, 0) -- Set to green when visible
- end
- end
- end)
- return ToggleFrame
- end
- -- Crear toggles para ESP
- local espToggles = {
- {name = "ESP de Caja", icon = "rbxassetid://3926305904", callback = function(value) Config.BoxESP = value end},
- {name = "ESP de Salud", icon = "rbxassetid://3926307971", callback = function(value) Config.HealthESP = value end},
- {name = "ESP de Nombre", icon = "rbxassetid://3926305904", callback = function(value) Config.NameESP = value end},
- {name = "ESP de Trazador", icon = "rbxassetid://3926305904", callback = function(value) Config.TracerESP = value end},
- {name = "ESP de Distancia", icon = "rbxassetid://3926305904", callback = function(value) Config.DistanceESP = value end},
- {name = "ESP de Highlight", icon = "rbxassetid://3926305904", callback = function(value) Config.HighlightESP = value end},
- }
- for i, toggle in ipairs(espToggles) do
- local toggleFrame = CreateToggle(ESPFrame, toggle.name, toggle.icon, toggle.callback)
- toggleFrame.Position = UDim2.new(0, 0, 0, (i-1) * 35)
- end
- -- Crear toggles para Perseguir
- local perseguirToggles = {
- {name = "Perseguir Usuario", icon = "rbxassetid://3926307971", callback = function(value) Config.PerseguirUsuario = value end},
- {name = "Perseguir Ignorando", icon = "rbxassetid://3926307971", callback = function(value) Config.PerseguirIgnorando = value end},
- }
- for i, toggle in ipairs(perseguirToggles) do
- local toggleFrame = CreateToggle(PerseguirFrame, toggle.name, toggle.icon, toggle.callback)
- toggleFrame.Position = UDim2.new(0, 0, 0, (i-1) * 35)
- end
- -- Función para crear un campo de entrada de texto
- local function CreateTextInput(parent, name, defaultValue, callback)
- local InputFrame = Instance.new("Frame")
- InputFrame.Size = UDim2.new(1, 0, 0, 50)
- InputFrame.BackgroundTransparency = 1
- InputFrame.Parent = parent
- local NameLabel = Instance.new("TextLabel")
- NameLabel.Size = UDim2.new(1, 0, 0, 20)
- NameLabel.Position = UDim2.new(0, 0, 0, 0)
- NameLabel.Text = name
- NameLabel.TextColor3 = Color3.new(1, 1, 1)
- NameLabel.TextXAlignment = Enum.TextXAlignment.Left
- NameLabel.BackgroundTransparency = 1
- NameLabel.Font = Enum.Font.Gotham
- NameLabel.TextSize = 14
- NameLabel.Parent = InputFrame
- local InputBox = Instance.new("TextBox")
- InputBox.Size = UDim2.new(1, 0, 0, 30)
- InputBox.Position = UDim2.new(0, 0, 0, 20)
- InputBox.Text = tostring(defaultValue)
- InputBox.TextColor3 = Color3.new(1, 1, 1)
- InputBox.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- InputBox.BorderSizePixel = 0
- InputBox.Font = Enum.Font.Gotham
- InputBox.TextSize = 14
- InputBox.Parent = InputFrame
- InputBox.FocusLost:Connect(function(enterPressed)
- if enterPressed then
- local value = tonumber(InputBox.Text)
- if value then
- callback(value)
- valueChangeSound:Play()
- else
- InputBox.Text = tostring(defaultValue)
- end
- end
- end)
- return InputFrame
- end
- -- Crear campos de entrada de texto para configuraciones de perseguir
- local followDistanceInput = CreateTextInput(PerseguirFrame, "Distancia de Seguimiento", Config.FOLLOW_DISTANCE, function(value)
- Config.FOLLOW_DISTANCE = value
- end)
- followDistanceInput.Position = UDim2.new(0, 0, 0, 70)
- local predictionTimeInput = CreateTextInput(PerseguirFrame, "Tiempo de Predicción", Config.PREDICTION_TIME, function(value)
- Config.PREDICTION_TIME = value
- end)
- predictionTimeInput.Position = UDim2.new(0, 0, 0, 130)
- -- Crear campos de entrada de texto para opacidad de ESP
- local espOpacityInputs = {
- {name = "Opacidad de Caja", callback = function(value) Config.BoxESPOpacity = value / 100 end},
- {name = "Opacidad de Salud", callback = function(value) Config.HealthESPOpacity = value / 100 end},
- {name = "Opacidad de Nombre", callback = function(value) Config.NameESPOpacity = value / 100 end},
- {name = "Opacidad de Trazador", callback = function(value) Config.TracerESPOpacity = value / 100 end},
- {name = "Opacidad de Distancia", callback = function(value) Config.DistanceESPOpacity = value / 100 end},
- {name = "Opacidad de Highlight", callback = function(value) Config.HighlightESPOpacity = value / 100 end},
- }
- for i, input in ipairs(espOpacityInputs) do
- local inputFrame = CreateTextInput(OtrosFrame, input.name, 100, input.callback)
- inputFrame.Position = UDim2.new(0, 0, 0, (i-1) * 60)
- end
- -- Función para crear un selector de color
- local function CreateColorPicker(parent, name, defaultColor, callback)
- local ColorPickerFrame = Instance.new("Frame")
- ColorPickerFrame.Size = UDim2.new(1, 0, 0, 30)
- ColorPickerFrame.BackgroundTransparency = 1
- ColorPickerFrame.Parent = parent
- local NameLabel = Instance.new("TextLabel")
- NameLabel.Size = UDim2.new(1, -40, 1, 0)
- NameLabel.Position = UDim2.new(0, 0, 0, 0)
- NameLabel.Text = name
- NameLabel.TextColor3 = Color3.new(1, 1, 1)
- NameLabel.TextXAlignment = Enum.TextXAlignment.Left
- NameLabel.BackgroundTransparency = 1
- NameLabel.Font = Enum.Font.Gotham
- NameLabel.TextSize = 14
- NameLabel.Parent = ColorPickerFrame
- local ColorButton = Instance.new("TextButton")
- ColorButton.Size = UDim2.new(0, 30, 0, 30)
- ColorButton.Position = UDim2.new(1, -30, 0, 0)
- ColorButton.Text = ""
- ColorButton.BackgroundColor3 = defaultColor
- ColorButton.BorderSizePixel = 0
- ColorButton.Parent = ColorPickerFrame
- local colorPalette = CreateColorPalette(ScreenGui, function(color)
- ColorButton.BackgroundColor3 = color
- callback(color)
- end)
- ColorButton.MouseButton1Click:Connect(function()
- buttonClickSound:Play()
- colorPalette.Visible = true
- end)
- return ColorPickerFrame
- end
- -- Crear selectores de color para la sección "Otros"
- local colorPickers = {
- {name = "Color de Botones", callback = function(color)
- ESPButton.BackgroundColor3 = color
- PerseguirButton.BackgroundColor3 = color
- OtrosButton.BackgroundColor3 = color
- end},
- {name = "Color de Texto", callback = function(color)
- ESPButton.TextColor3 = color
- PerseguirButton.TextColor3 = color
- OtrosButton.TextColor3 = color
- TitleLabel.TextColor3 = color
- end},
- {name = "Color de Fondo", callback = function(color)
- MainPanel.BackgroundColor3 = color
- end},
- {name = "Color de Interfaz", callback = function(color)
- for _, frame in ipairs({ESPFrame, PerseguirFrame, OtrosFrame}) do
- for _, child in ipairs(frame:GetChildren()) do
- if child:IsA("Frame") or child:IsA("TextBox") then
- child.BackgroundColor3 = color
- end
- end
- end
- end},
- {name = "Color de Botón Menú", callback = function(color)
- CircleButton.ImageColor3 = color
- end},
- {name = "Color de ESP Perseguir", callback = function(color)
- Config.PerseguirHighlightColor = color
- end},
- }
- for i, picker in ipairs(colorPickers) do
- local pickerFrame = CreateColorPicker(OtrosFrame, picker.name, Color3.new(1, 1, 1), picker.callback)
- pickerFrame.Position = UDim2.new(0, 0, 0, 360 + (i-1) * 40)
- end
- -- Crear campos de entrada de texto para opacidad de la interfaz
- local uiOpacityInputs = {
- {name = "Opacidad de Interfaz", callback = function(value)
- Config.UIOpacity = value / 100
- MainPanel.BackgroundTransparency = 1 - Config.UIOpacity
- end},
- {name = "Opacidad de Botón Menú", callback = function(value)
- Config.ButtonOpacity = value / 100
- CircleButton.ImageTransparency = 1 - Config.ButtonOpacity
- end},
- }
- for i, input in ipairs(uiOpacityInputs) do
- local inputFrame = CreateTextInput(OtrosFrame, input.name, 100, input.callback)
- inputFrame.Position = UDim2.new(0, 0, 0, 560 + (i-1) * 60)
- end
- -- Funcionalidad de los botones de sección
- ESPButton.MouseButton1Click:Connect(function()
- changeSectionSound:Play()
- ESPFrame.Visible = true
- PerseguirFrame.Visible = false
- OtrosFrame.Visible = false
- ESPButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
- PerseguirButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- OtrosButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- end)
- PerseguirButton.MouseButton1Click:Connect(function()
- changeSectionSound:Play()
- ESPFrame.Visible = false
- PerseguirFrame.Visible = true
- OtrosFrame.Visible = false
- ESPButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- PerseguirButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
- OtrosButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- end)
- OtrosButton.MouseButton1Click:Connect(function()
- changeSectionSound:Play()
- ESPFrame.Visible = false
- PerseguirFrame.Visible = false
- OtrosFrame.Visible = true
- ESPButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- PerseguirButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- OtrosButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
- end)
- -- Animación de apertura/cierre del panel
- CircleButton.MouseButton1Click:Connect(function()
- buttonClickSound:Play()
- MainPanel.Visible = not MainPanel.Visible
- if MainPanel.Visible then
- openMenuSound:Play()
- MainPanel:TweenSize(
- UDim2.new(0, 300, 0, 400),
- Enum.EasingDirection.Out,
- Enum.EasingStyle.Quad,
- 0.3,
- true
- )
- else
- closeMenuSound:Play()
- MainPanel:TweenSize(
- UDim2.new(0, 0, 0, 0),
- Enum.EasingDirection.In,
- Enum.EasingStyle.Quad,
- 0.3,
- true,
- function()
- MainPanel.Visible = false
- end
- )
- end
- end)
- -- Funcionalidad del botón de activar/desactivar Perseguir
- local isPerseguirActive = false
- PerseguirToggleButton.MouseButton1Click:Connect(function()
- buttonClickSound:Play()
- isPerseguirActive = not isPerseguirActive
- if isPerseguirActive then
- TweenService:Create(PerseguirToggleButton, TweenInfo.new(0.2), {ImageColor3 = Color3.fromRGB(0, 255, 0)}):Play()
- if Config.PerseguirUsuario then
- Config.PerseguirUsuario = true
- Config.PerseguirIgnorando = false
- elseif Config.PerseguirIgnorando then
- Config.PerseguirUsuario = false
- Config.PerseguirIgnorando = true
- end
- else
- TweenService:Create(PerseguirToggleButton, TweenInfo.new(0.2), {ImageColor3 = Color3.fromRGB(255, 0, 0)}):Play()
- Config.PerseguirUsuario = false
- Config.PerseguirIgnorando = false
- end
- end)
- -- Función para obtener el jugador más cercano
- local function getClosestPlayer()
- local player = game.Players.LocalPlayer
- local closestDistance = math.huge
- local closestPlayer = nil
- for _, otherPlayer in pairs(game.Players:GetPlayers()) do
- if otherPlayer ~= player and otherPlayer.Character and otherPlayer.Character:FindFirstChild("HumanoidRootPart") and otherPlayer.Character:FindFirstChild("Humanoid") and otherPlayer.Character.Humanoid.Health > 0 then
- local distance = (player.Character.HumanoidRootPart.Position - otherPlayer.Character.HumanoidRootPart.Position).Magnitude
- if distance < closestDistance then
- closestDistance = distance
- closestPlayer = otherPlayer
- end
- end
- end
- return closestPlayer
- end
- -- Función para resaltar al jugador más cercano
- local function highlightPlayer(targetPlayer)
- if targetPlayer and targetPlayer.Character then
- -- Crear el Highlight si no existe
- local highlight = targetPlayer.Character:FindFirstChild("Highlight") or Instance.new("Highlight")
- highlight.Name = "Highlight"
- highlight.Parent = targetPlayer.Character
- highlight.Adornee = targetPlayer.Character
- highlight.FillColor = Config.PerseguirHighlightColor
- highlight.FillTransparency = 0.5
- highlight.OutlineColor = Color3.new(0, 0, 0)
- highlight.OutlineTransparency = 0
- end
- end
- -- Loop para actualizar al jugador más cercano
- spawn(function()
- while wait(0.5) do
- local closestPlayer = getClosestPlayer()
- -- Limpiar antiguos Highlight
- for _, otherPlayer in pairs(game.Players:GetPlayers()) do
- if otherPlayer.Character then
- local highlight = otherPlayer.Character:FindFirstChild("Highlight")
- if highlight and highlight ~= otherPlayer.Character:FindFirstChild("PlayerESPHighlight") then
- highlight:Destroy()
- end
- end
- end
- -- Resaltar al jugador más cercano si Perseguir está activo
- if isPerseguirActive and (Config.PerseguirUsuario or Config.PerseguirIgnorando) then
- if closestPlayer then
- highlightPlayer(closestPlayer)
- end
- end
- end
- end)
- -- Función para crear ESP
- local function CreateESP(player)
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local humanoid = character:WaitForChild("Humanoid")
- -- Box ESP
- local boxESP = Drawing.new("Square")
- boxESP.Visible = false
- boxESP.Color = Config.BoxESPColor
- boxESP.Thickness = 1
- boxESP.Transparency = Config.BoxESPOpacity
- boxESP.Filled = false
- -- Health ESP
- local healthESP = Drawing.new("Text")
- healthESP.Visible = false
- healthESP.Color = Config.HealthESPColor
- healthESP.Size = 14
- healthESP.Center = true
- healthESP.Outline = true
- healthESP.Transparency = Config.HealthESPOpacity
- -- Name ESP
- local nameESP = Drawing.new("Text")
- nameESP.Visible = false
- nameESP.Color = Config.NameESPColor
- nameESP.Size = 18
- nameESP.Center = true
- nameESP.Outline = true
- nameESP.Transparency = Config.NameESPOpacity
- -- Tracer ESP
- local tracerESP = Drawing.new("Line")
- tracerESP.Visible = false
- tracerESP.Color = Config.TracerESPColor
- tracerESP.Thickness = 1
- tracerESP.Transparency = Config.TracerESPOpacity
- -- Distance ESP
- local distanceESP = Drawing.new("Text")
- distanceESP.Visible = false
- distanceESP.Color = Config.DistanceESPColor
- distanceESP.Size = 14
- distanceESP.Center = true
- distanceESP.Outline = true
- distanceESP.Transparency = Config.DistanceESPOpacity
- -- Highlight ESP
- local highlight = Instance.new("Highlight")
- highlight.Name = "PlayerESPHighlight"
- highlight.FillColor = Config.HighlightFillColor
- highlight.OutlineColor = Config.HighlightOutlineColor
- highlight.FillTransparency = 1 - Config.HighlightESPOpacity
- highlight.OutlineTransparency = 0
- highlight.Adornee = character
- highlight.Parent = character
- highlight.Enabled = false
- local function UpdateESP()
- if not character:IsDescendantOf(game.Workspace) then
- boxESP.Visible = false
- healthESP.Visible = false
- nameESP.Visible = false
- tracerESP.Visible = false
- distanceESP.Visible = false
- highlight.Enabled = false
- return
- end
- local vector, onScreen = workspace.CurrentCamera:WorldToViewportPoint(humanoidRootPart.Position)
- if onScreen then
- -- Update Box ESP
- if Config.BoxESP then
- local topLeft = workspace.CurrentCamera:WorldToViewportPoint((humanoidRootPart.CFrame * CFrame.new(-3, 3, 0)).Position)
- local topRight = workspace.CurrentCamera:WorldToViewportPoint((humanoidRootPart.CFrame * CFrame.new(3, 3, 0)).Position)
- local bottomLeft = workspace.CurrentCamera:WorldToViewportPoint((humanoidRootPart.CFrame * CFrame.new(-3, -3, 0)).Position)
- local bottomRight = workspace.CurrentCamera:WorldToViewportPoint((humanoidRootPart.CFrame * CFrame.new(3, -3, 0)).Position)
- boxESP.PointA = Vector2.new(topLeft.X, topLeft.Y)
- boxESP.PointB = Vector2.new(topRight.X, topRight.Y)
- boxESP.PointC = Vector2.new(bottomRight.X, bottomRight.Y)
- boxESP.PointD = Vector2.new(bottomLeft.X, bottomLeft.Y)
- boxESP.Color = Config.BoxESPColor
- boxESP.Transparency = Config.BoxESPOpacity
- boxESP.Visible = true
- else
- boxESP.Visible = false
- end
- -- Update Health ESP
- if Config.HealthESP then
- local health = math.floor(humanoid.Health)
- local maxHealth = math.floor(humanoid.MaxHealth)
- healthESP.Text = health .. "/" .. maxHealth
- healthESP.Position = Vector2.new(vector.X, vector.Y + 40)
- healthESP.Color = Config.HealthESPColor
- healthESP.Transparency = Config.HealthESPOpacity
- healthESP.Visible = true
- else
- healthESP.Visible = false
- end
- -- Update Name ESP
- if Config.NameESP then
- nameESP.Text = player.Name
- nameESP.Position = Vector2.new(vector.X, vector.Y - 40)
- nameESP.Color = Config.NameESPColor
- nameESP.Transparency = Config.NameESPOpacity
- nameESP.Visible = true
- else
- nameESP.Visible = false
- end
- -- Update Tracer ESP
- if Config.TracerESP then
- tracerESP.From = Vector2.new(workspace.CurrentCamera.ViewportSize.X / 2, workspace.CurrentCamera.ViewportSize.Y)
- tracerESP.To = Vector2.new(vector.X, vector.Y)
- tracerESP.Color = Config.TracerESPColor
- tracerESP.Transparency = Config.TracerESPOpacity
- tracerESP.Visible = true
- else
- tracerESP.Visible = false
- end
- -- Update Distance ESP
- if Config.DistanceESP then
- local distance = math.floor((workspace.CurrentCamera.CFrame.Position - humanoidRootPart.Position).Magnitude)
- distanceESP.Text = tostring(distance) .. "m"
- distanceESP.Position = Vector2.new(vector.X, vector.Y + 60)
- distanceESP.Color = Config.DistanceESPColor
- distanceESP.Transparency = Config.DistanceESPOpacity
- distanceESP.Visible = true
- else
- distanceESP.Visible = false
- end
- -- Update Highlight ESP
- if Config.HighlightESP then
- highlight.FillColor = Config.HighlightFillColor
- highlight.OutlineColor = Config.HighlightOutlineColor
- highlight.FillTransparency = 1 - Config.HighlightESPOpacity
- highlight.Enabled = true
- else
- highlight.Enabled = false
- end
- -- Update Perseguir Highlight
- if isPerseguirActive and (Config.PerseguirUsuario or Config.PerseguirIgnorando) and player == getClosestPlayer() then
- highlight.FillColor = Config.PerseguirHighlightColor
- highlight.Enabled = true
- elseif Config.HighlightESP then
- highlight.FillColor = Config.HighlightFillColor
- else
- highlight.Enabled = false
- end
- else
- boxESP.Visible = false
- healthESP.Visible = false
- nameESP.Visible = false
- tracerESP.Visible = false
- distanceESP.Visible = false
- highlight.Enabled = false
- end
- end
- RunService.RenderStepped:Connect(UpdateESP)
- end
- -- Crear ESP para jugadores existentes
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- CreateESP(player)
- end
- end
- -- Crear ESP para nuevos jugadores
- Players.PlayerAdded:Connect(function(player)
- CreateESP(player)
- end)
- -- Función para verificar usuarios sin ESP
- local function CheckPlayersWithoutESP()
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- local character = player.Character
- if character then
- local hasESP = character:FindFirstChild("PlayerESPHighlight")
- if not hasESP then
- CreateESP(player)
- end
- end
- end
- end
- end
- -- Verificar usuarios sin ESP cada 1.5 segundos
- spawn(function()
- while wait(1.5) do
- CheckPlayersWithoutESP()
- end
- end)
- -- Función para verificar si un personaje tiene ítems
- local function DoesCharacterHaveItem(character)
- if not character then return false end
- for _, tool in ipairs(character:GetChildren()) do
- if tool:IsA("Tool") then
- return true
- end
- end
- return false
- end
- -- Función para predecir la posición futura
- local function PredictPosition(player)
- local character = player.Character
- if not character then return nil end
- local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
- if not humanoidRootPart then return nil end
- local velocity = humanoidRootPart.Velocity
- return humanoidRootPart.Position + velocity * Config.PREDICTION_TIME
- end
- -- Función principal de persecución
- local function PursueTarget()
- local character = Players.LocalPlayer.Character
- if not character or not DoesCharacterHaveItem(character) then return end
- local closestPlayer = getClosestPlayer()
- if not closestPlayer then return end
- if Config.PerseguirUsuario and isPerseguirActive then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid then
- local targetPosition = closestPlayer.Character.HumanoidRootPart.Position
- humanoid:MoveTo(targetPosition)
- end
- elseif Config.PerseguirIgnorando and isPerseguirActive then
- local predictedPosition = PredictPosition(closestPlayer)
- if predictedPosition then
- local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
- if humanoidRootPart then
- local distance = (predictedPosition - humanoidRootPart.Position).Magnitude
- if distance > Config.FOLLOW_DISTANCE then
- local humanoid = character:FindFirstChild("Humanoid")
- if humanoid then
- humanoid:MoveTo(predictedPosition)
- end
- end
- end
- end
- end
- end
- -- Conectar la función PursueTarget al bucle RunService
- RunService.Heartbeat:Connect(PursueTarget)
- -- Función para actualizar los colores de los ESP
- local function UpdateESPColors()
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- local character = player.Character
- if character then
- local highlight = character:FindFirstChild("PlayerESPHighlight")
- if highlight and highlight:IsA("Highlight") then
- highlight.FillColor = Config.HighlightFillColor
- highlight.OutlineColor = Config.HighlightOutlineColor
- highlight.FillTransparency = 1 - Config.HighlightESPOpacity
- end
- end
- end
- end
- end
- -- Función para verificar highlights existentes
- local function CheckExistingHighlights()
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer then
- local character = player.Character
- if character then
- local existingHighlight = character:FindFirstChild("Highlight")
- local espHighlight = character:FindFirstChild("PlayerESPHighlight")
- if existingHighlight and espHighlight and existingHighlight ~= espHighlight then
- espHighlight.Enabled = false
- elseif not existingHighlight and espHighlight then
- espHighlight.Enabled = Config.HighlightESP
- end
- end
- end
- end
- end
- -- Ejecutar la verificación de highlights cada 2 segundos
- spawn(function()
- while wait(2) do
- CheckExistingHighlights()
- end
- end)
- -- Fin del script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement