--// Plants vs Brainrots HUB
-- GUI plegable + rainbow + toggles
local Players = game:GetService("Players")
local player = Players.LocalPlayer
-- GUI
local ScreenGui = Instance.new("ScreenGui", game.CoreGui)
ScreenGui.Name = "PvBHub"
-- Frame principal
local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 250, 0, 200)
Frame.Position = UDim2.new(0.05, 0, 0.3, 0)
Frame.BackgroundTransparency = 0.4
Frame.BackgroundColor3 = Color3.fromRGB(20,20,20)
Frame.Parent = ScreenGui
Frame.Visible = true
-- Rainbow border
local UIStroke = Instance.new("UIStroke")
UIStroke.Thickness = 3
UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
UIStroke.Parent = Frame
task.spawn(function()
while task.wait() do
for h = 0,1,0.01 do
UIStroke.Color = Color3.fromHSV(h,1,1)
task.wait(0.03)
end
end
end)
-- Botón para plegar/desplegar
local ToggleHub = Instance.new("TextButton")
ToggleHub.Size = UDim2.new(0, 250, 0, 25)
ToggleHub.Position = UDim2.new(0,0,0,-25)
ToggleHub.BackgroundColor3 = Color3.fromRGB(30,30,30)
ToggleHub.TextColor3 = Color3.new(1,1,1)
ToggleHub.Text = "≡ PvB Hub"
ToggleHub.Parent = Frame
local hubVisible = true
ToggleHub.MouseButton1Click:Connect(function()
hubVisible = not hubVisible
for _, child in ipairs(Frame:GetChildren()) do
if child:IsA("TextButton") and child ~= ToggleHub then
child.Visible = hubVisible
end
end
end)
-- Estados
local autoFarm = false
local dupe = false
local autoKill = false
-- Crear botón toggle
local function createToggle(name, posY, callback)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(0, 230, 0, 40)
btn.Position = UDim2.new(0, 10, 0, posY)
btn.BackgroundColor3 = Color3.fromRGB(40,40,40)
btn.TextColor3 = Color3.new(1,1,1)
btn.Text = name.." [OFF]"
btn.Parent = Frame
local state = false
btn.MouseButton1Click:Connect(function()
state = not state
btn.Text = name.." ["..(state and "ON" or "OFF").."]"
callback(state)
end)
return btn
end
-- Opción 1: AutoFarm
createToggle("AutoFarm", 20, function(enabled)
autoFarm = enabled
if autoFarm then
warn("AutoFarm activado")
task.spawn(function()
while autoFarm do
task.wait(1)
-- TODO: aquí va la lógica para moverse hacia un Brainrot y atacarlo
-- Ejemplo: player.Character:MoveTo(Vector3.new(...))
end
end)
else
warn("AutoFarm desactivado")
end
end)
-- Opción 2: Dupe
createToggle("Dupe", 70, function(enabled)
dupe = enabled
if dupe then
warn("Dupe activado")
-- TODO: lógica para duplicar el objeto seleccionado
else
warn("Dupe desactivado")
end
end)
-- Opción 3: AutoKill
createToggle("AutoKill", 120, function(enabled)
autoKill = enabled
if autoKill then
warn("AutoKill activado")
task.spawn(function()
while autoKill do
task.wait(0.5)
-- TODO: lógica para detectar Brainrots cercanos y eliminarlos
end
end)
else
warn("AutoKill desactivado")
end
end)