Pastefi mark
Untitled
/e59c2749
Paste view
NONE PUBLIC 43 views
e59c2749
2025-10-31 04:04:12
-- Developer testing script (LocalScript) con GUI movible y minimizable
-- USO: Pegar en StarterPlayer -> StarterPlayerScripts
-- KEY: 1231
-- Sólo para tu propio juego / testing

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

-- Estado
local enabled = {
    oneHit = false,
    invisible = false,
    noclip = false,
    immortal = false,
}

local ACTIVATION_KEY = "1231"

-- GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "DevPowerGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = player:WaitForChild("PlayerGui")

-- Main window (container)
local window = Instance.new("Frame")
window.Name = "MainWindow"
window.Size = UDim2.new(0, 280, 0, 250)
window.Position = UDim2.new(0, 10, 0, 10)
window.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
window.BorderSizePixel = 0
window.AnchorPoint = Vector2.new(0, 0)
window.Parent = screenGui
window.Active = true -- allow input capture for dragging

-- Shadow / rounded feel (optional)
local corner = Instance.new("UICorner", window)
corner.CornerRadius = UDim.new(0, 8)

-- Header (draggable + title + minimize)
local header = Instance.new("Frame")
header.Name = "Header"
header.Size = UDim2.new(1, 0, 0, 34)
header.Position = UDim2.new(0, 0, 0, 0)
header.BackgroundTransparency = 1
header.Parent = window

local title = Instance.new("TextLabel", header)
title.Name = "Title"
title.Size = UDim2.new(1, -70, 1, 0)
title.Position = UDim2.new(0, 10, 0, 0)
title.BackgroundTransparency = 1
title.Text = "Dev Powers (key: 1231)"
title.Font = Enum.Font.SourceSansBold
title.TextSize = 16
title.TextColor3 = Color3.fromRGB(255,255,255)
title.TextXAlignment = Enum.TextXAlignment.Left

local minimizeBtn = Instance.new("TextButton", header)
minimizeBtn.Name = "Minimize"
minimizeBtn.Size = UDim2.new(0, 26, 0, 26)
minimizeBtn.Position = UDim2.new(1, -36, 0, 4)
minimizeBtn.Text = "-"
minimizeBtn.Font = Enum.Font.SourceSansBold
minimizeBtn.TextSize = 18
minimizeBtn.BackgroundTransparency = 0.15
minimizeBtn.TextColor3 = Color3.fromRGB(255,255,255)
minimizeBtn.AutoButtonColor = true

local closeBtn = Instance.new("TextButton", header)
closeBtn.Name = "Close"
closeBtn.Size = UDim2.new(0, 26, 0, 26)
closeBtn.Position = UDim2.new(1, -68, 0, 4)
closeBtn.Text = "x"
closeBtn.Font = Enum.Font.SourceSansBold
closeBtn.TextSize = 16
closeBtn.BackgroundTransparency = 0.15
closeBtn.TextColor3 = Color3.fromRGB(255,255,255)
closeBtn.AutoButtonColor = true

-- Content area
local content = Instance.new("Frame")
content.Name = "Content"
content.Size = UDim2.new(1, -20, 1, -54)
content.Position = UDim2.new(0, 10, 0, 44)
content.BackgroundTransparency = 1
content.Parent = window

-- Simple layout inside content
local uiList = Instance.new("UIListLayout", content)
uiList.Padding = UDim.new(0, 8)
uiList.FillDirection = Enum.FillDirection.Vertical
uiList.SortOrder = Enum.SortOrder.LayoutOrder
uiList.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiList.VerticalAlignment = Enum.VerticalAlignment.Top

-- Key entry row
local keyRow = Instance.new("Frame", content)
keyRow.Size = UDim2.new(1, 0, 0, 40)
keyRow.BackgroundTransparency = 1

local keyBox = Instance.new("TextBox", keyRow)
keyBox.Size = UDim2.new(0.62, 0, 1, 0)
keyBox.Position = UDim2.new(0, 0, 0, 0)
keyBox.PlaceholderText = "Introduce key (ej: 1231)"
keyBox.ClearTextOnFocus = false
keyBox.Text = ""
keyBox.Font = Enum.Font.SourceSans
keyBox.TextSize = 14
keyBox.BackgroundColor3 = Color3.fromRGB(45,45,45)
keyBox.BorderSizePixel = 0
keyBox.TextColor3 = Color3.fromRGB(255,255,255)

local unlockBtn = Instance.new("TextButton", keyRow)
unlockBtn.Size = UDim2.new(0.36, 0, 1, 0)
unlockBtn.Position = UDim2.new(0.64, 0, 0, 0)
unlockBtn.Text = "Unlock"
unlockBtn.Font = Enum.Font.SourceSansBold
unlockBtn.TextSize = 14
unlockBtn.BackgroundColor3 = Color3.fromRGB(60,140,60)
unlockBtn.BorderSizePixel = 0
unlockBtn.TextColor3 = Color3.fromRGB(255,255,255)

-- Status label
local statusLabel = Instance.new("TextLabel", content)
statusLabel.Size = UDim2.new(1, 0, 0, 20)
statusLabel.BackgroundTransparency = 1
statusLabel.Text = "Estado: Bloqueado"
statusLabel.Font = Enum.Font.SourceSansSemibold
statusLabel.TextSize = 13
statusLabel.TextColor3 = Color3.fromRGB(200,200,200)
statusLabel.TextXAlignment = Enum.TextXAlignment.Left

-- Toggle buttons container
local toggles = Instance.new("Frame", content)
toggles.Size = UDim2.new(1, 0, 0, 140)
toggles.BackgroundTransparency = 1

local function makeToggle(name, order)
    local btn = Instance.new("TextButton", toggles)
    btn.Size = UDim2.new(1, -20, 0, 32)
    btn.Position = UDim2.new(0, 10, 0, (order-1) * 36)
    btn.Text = name .. ": OFF"
    btn.Font = Enum.Font.SourceSans
    btn.TextSize = 14
    btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
    btn.BorderSizePixel = 0
    btn.TextColor3 = Color3.fromRGB(255,255,255)
    return btn
end

local btnOneHit = makeToggle("1-Hit Kill", 1)
local btnInvisible = makeToggle("Invisibilidad", 2)
local btnNoclip = makeToggle("Traspasar paredes (Noclip)", 3)
local btnImmortal = makeToggle("Inmortalidad", 4)

-- Keep track of unlocked and minimized states
local unlocked = false
local minimized = false

-- Unlock handler
unlockBtn.MouseButton1Click:Connect(function()
    if keyBox.Text == ACTIVATION_KEY then
        unlocked = true
        statusLabel.Text = "Estado: Desbloqueado (DEV MODE)"
        keyBox.Text = ""
    else
        statusLabel.Text = "Estado: Key incorrecta"
    end
end)

-- Toggle handlers
local function setBtnText(btn, name, on)
    if on then
        btn.Text = name .. ": ON"
    else
        btn.Text = name .. ": OFF"
    end
end

btnOneHit.MouseButton1Click:Connect(function()
    if not unlocked then statusLabel.Text = "Primero desbloquea con la key" return end
    enabled.oneHit = not enabled.oneHit
    setBtnText(btnOneHit, "1-Hit Kill", enabled.oneHit)
end)

btnInvisible.MouseButton1Click:Connect(function()
    if not unlocked then statusLabel.Text = "Primero desbloquea con la key" return end
    enabled.invisible = not enabled.invisible
    setBtnText(btnInvisible, "Invisibilidad", enabled.invisible)
end)

btnNoclip.MouseButton1Click:Connect(function()
    if not unlocked then statusLabel.Text = "Primero desbloquea con la key" return end
    enabled.noclip = not enabled.noclip
    setBtnText(btnNoclip, "Traspasar paredes (Noclip)", enabled.noclip)
end)

btnImmortal.MouseButton1Click:Connect(function()
    if not unlocked then statusLabel.Text = "Primero desbloquea con la key" return end
    enabled.immortal = not enabled.immortal
    setBtnText(btnImmortal, "Inmortalidad", enabled.immortal)
end)

-- Minimize / Restore behavior
local savedSize = window.Size
local savedContentVisible = true
minimizeBtn.MouseButton1Click:Connect(function()
    minimized = not minimized
    if minimized then
        -- reducir a barra
        window.Size = UDim2.new(0, 280, 0, 36)
        content.Visible = false
        minimizeBtn.Text = "+"
    else
        -- restaurar
        window.Size = savedSize
        content.Visible = true
        minimizeBtn.Text = "-"
    end
end)

closeBtn.MouseButton1Click:Connect(function()
    screenGui:Destroy()
end)

-- Draggable window (arrastrar con header)
local dragging = false
local dragStart = nil
local startPos = nil

local function updatePosition(input)
    if not dragging then return end
    local delta = input.Position - dragStart
    window.Position = UDim2.new(0, startPos.X + delta.X, 0, startPos.Y + delta.Y)
end

header.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        local absPos = window.AbsolutePosition
        startPos = Vector2.new(absPos.X, absPos.Y)
        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then
                dragging = false
            end
        end)
    end
end)

header.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
        -- nothing needed here; we'll use UserInputService to track movement
    end
end)

-- For smooth tracking use UserInputService.InputChanged
UserInputService.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
        updatePosition(input)
    end
end)

-- UTIL FUNCTIONS (mismo comportamiento que antes)
local function setCharacterInvisibility(char, value)
    for _,desc in pairs(char:GetDescendants()) do
        if desc:IsA("BasePart") then
            if value then
                desc.Transparency = 1
                desc.CanCollide = false
            else
                desc.Transparency = 0
                desc.CanCollide = true
            end
        elseif desc:IsA("Decal") or desc:IsA("Texture") then
            desc.Transparency = (value and 1) or 0
        end
    end
end

local function setCharacterNoclip(char, value)
    for _,p in pairs(char:GetDescendants()) do
        if p:IsA("BasePart") then
            p.CanCollide = not value
        end
    end
end

local function makeOneHitForNPCs()
    local npcFolder = workspace:FindFirstChild("NPCs")
    if not npcFolder then return end
    for _,npc in pairs(npcFolder:GetChildren()) do
        local h = npc:FindFirstChildOfClass("Humanoid")
        if h then
            h.HealthChanged:Connect(function()
                if enabled.oneHit and h.Health > 0 then
                    h.Health = 0
                end
            end)
        end
    end
end

local function setupImmortal(hum)
    hum.HealthChanged:Connect(function()
        if enabled.immortal then
            if hum.Health < 1 then
                hum.Health = hum.MaxHealth
            end
        end
    end)
end

-- Keep track of character respawn
local function onCharacterAdded(char)
    character = char
    humanoid = char:WaitForChild("Humanoid")
    setupImmortal(humanoid)
end

player.CharacterAdded:Connect(onCharacterAdded)

-- Loop para aplicar invisibilidad/noclip
RunService.RenderStepped:Connect(function()
    if player.Character then
        if enabled.invisible then
            setCharacterInvisibility(player.Character, true)
        else
            setCharacterInvisibility(player.Character, false)
        end

        if enabled.noclip then
            setCharacterNoclip(player.Character, true)
        else
            setCharacterNoclip(player.Character, false)
        end
    end
end)

-- Inicializaciones
if player.Character then
    onCharacterAdded(player.Character)
end
makeOneHitForNPCs()
statusLabel.Text = "Estado: Esperando unlock (key: 1231)"

Comments (0)

Log in to leave a comment.

No comments yet.