Project scp aimbot u*fuscated
Key Required

Project scp aimbot u*fuscated

Project: SCPdereksseptini20dereksseptini20 3.3K views 36 executesUpdated Nov 9, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•270 lines (9932 chars)
-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local CurrentCamera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer

-- CONFIG
local AimPartName = "Head"
local AimSpeed = 0.2
local FOVRadius = 150

-- NEW FEATURES (toggle here)
local StickyAim = true   -- when true: lock on a target until aimbot toggled off or target invalid
local NoSleep  = true    -- when true: use Heartbeat loop to be less affected by yields/sleep

-- Control mode: false = Toggle mode (press to switch), true = Hold mode (hold key to aim)
local HoldMode = false

-- State
local mousePos = Vector2.new(CurrentCamera.ViewportSize.X/2, CurrentCamera.ViewportSize.Y/2)
local aimbotActive = false
local currentTarget = nil

-- Binding state (default bind = E)
local aimbotKeyInputType = Enum.UserInputType.Keyboard
local aimbotKeyCode = Enum.KeyCode.E
local settingKey = false

-- Helper: screen position of a part
local function GetScreenPos(part)
    local ok, pos, onScreen = pcall(function() return CurrentCamera:WorldToViewportPoint(part.Position) end)
    if ok and pos and onScreen then
        return Vector2.new(pos.X, pos.Y)
    end
    return nil
end

-- Closest target within FOV (relative to mouse)
local function GetClosestTarget()
    local closest = nil
    local shortest = FOVRadius
    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and player.Character then
            local part = player.Character:FindFirstChild(AimPartName)
            if part and part:IsA("BasePart") then
                local pos = GetScreenPos(part)
                if pos then
                    local dist = (pos - mousePos).Magnitude
                    if dist <= FOVRadius and dist < shortest then
                        shortest = dist
                        closest = part
                    end
                end
            end
        end
    end
    return closest
end

-- GUI Setup (draggable bind button + status + mode toggle)
local screenGui = Instance.new("ScreenGui")
screenGui.ResetOnSpawn = false
screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")

local bindButton = Instance.new("TextButton")
bindButton.Size = UDim2.new(0,170,0,40)
bindButton.Position = UDim2.new(0,20,0,20)
bindButton.Text = "Bind: E  |  Aimbot: OFF"
bindButton.TextColor3 = Color3.new(1,1,1)
bindButton.BackgroundColor3 = Color3.fromRGB(50,50,50)
bindButton.AutoButtonColor = false
bindButton.Parent = screenGui

local modeButton = Instance.new("TextButton")
modeButton.Size = UDim2.new(0,120,0,30)
modeButton.Position = UDim2.new(0,20,0,70)
modeButton.Text = "Mode: Toggle"
modeButton.TextColor3 = Color3.new(1,1,1)
modeButton.BackgroundColor3 = Color3.fromRGB(60,60,60)
modeButton.AutoButtonColor = false
modeButton.Parent = screenGui

-- Draggable logic for bind button
do
    local dragging = false
    local dragOffset = Vector2.new(0,0)
    bindButton.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = true
            local mouseLoc = UserInputService:GetMouseLocation()
            dragOffset = Vector2.new(mouseLoc.X, mouseLoc.Y) - Vector2.new(bindButton.AbsolutePosition.X, bindButton.AbsolutePosition.Y)
        end
    end)
    bindButton.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = false
        end
    end)
    UserInputService.InputChanged:Connect(function(input)
        if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
            local mouseLoc = UserInputService:GetMouseLocation()
            bindButton.Position = UDim2.new(0, math.clamp(mouseLoc.X - dragOffset.X, 0, CurrentCamera.ViewportSize.X - bindButton.AbsoluteSize.X),
                                            0, math.clamp(mouseLoc.Y - dragOffset.Y, 0, CurrentCamera.ViewportSize.Y - bindButton.AbsoluteSize.Y))
            -- also move modeButton to keep layout relative to bindButton
            modeButton.Position = UDim2.new(0, bindButton.AbsolutePosition.X, 0, bindButton.AbsolutePosition.Y + bindButton.AbsoluteSize.Y + 10)
        end
    end)
end

-- Clicking the bind button begins binding mode
bindButton.MouseButton1Click:Connect(function()
    settingKey = true
    bindButton.Text = "Press key or mouse..."
end)

-- Clicking the mode button toggles between Hold and Toggle mode
modeButton.MouseButton1Click:Connect(function()
    HoldMode = not HoldMode
    modeButton.Text = HoldMode and "Mode: Hold" or "Mode: Toggle"
    -- when switching to Hold mode, ensure aimbot isn't stuck ON erroneously
    if HoldMode == true and aimbotActive then
        aimbotActive = false
    end
    UpdateBindButtonText()
end)

-- Drawing FOV Circle (Drawing API)
local fovDrawing = Drawing.new("Circle")
fovDrawing.Color = Color3.new(1,1,1)
fovDrawing.Radius = FOVRadius
fovDrawing.Thickness = 1.5
fovDrawing.Transparency = 1
fovDrawing.Filled = false

-- Update button text helper
function UpdateBindButtonText()
    local keyText = ""
    if aimbotKeyInputType == Enum.UserInputType.Keyboard then
        keyText = (aimbotKeyCode and aimbotKeyCode.Name) or "None"
    else
        keyText = tostring(aimbotKeyInputType):gsub("Enum.UserInputType.","")
    end
    bindButton.Text = ("Bind: %s  |  Aimbot: %s"):format(keyText, aimbotActive and "ON" or "OFF")
    modeButton.Text = HoldMode and "Mode: Hold" or "Mode: Toggle"
end

-- Input handling: binding and toggling/holding
UserInputService.InputBegan:Connect(function(input, processed)
    -- binding mode: set the bound key/input
    if settingKey then
        settingKey = false
        if input.UserInputType == Enum.UserInputType.Keyboard then
            aimbotKeyInputType = Enum.UserInputType.Keyboard
            aimbotKeyCode = input.KeyCode
        else
            aimbotKeyInputType = input.UserInputType
            aimbotKeyCode = nil
        end
        UpdateBindButtonText()
        return
    end

    -- If this input matches the bound input type -> handle according to mode
    if input.UserInputType == aimbotKeyInputType then
        if aimbotKeyInputType == Enum.UserInputType.Keyboard then
            if aimbotKeyCode and input.KeyCode == aimbotKeyCode then
                if HoldMode then
                    -- Hold mode: start aiming while key is down
                    aimbotActive = true
                    UpdateBindButtonText()
                else
                    -- Toggle mode: flip state on press
                    aimbotActive = not aimbotActive
                    if not aimbotActive then currentTarget = nil end
                    UpdateBindButtonText()
                end
            end
        else
            -- Non-keyboard input types (mouse buttons, gamepad buttons, etc.)
            -- For these we treat the whole input type as the binding. Use HoldMode similarly.
            if HoldMode then
                aimbotActive = true
                UpdateBindButtonText()
            else
                aimbotActive = not aimbotActive
                if not aimbotActive then currentTarget = nil end
                UpdateBindButtonText()
            end
        end
    end
end)

-- Handle InputEnded for Hold mode to stop aiming when key/button is released
UserInputService.InputEnded:Connect(function(input, processed)
    if HoldMode then
        if input.UserInputType == aimbotKeyInputType then
            if aimbotKeyInputType == Enum.UserInputType.Keyboard then
                if aimbotKeyCode and input.KeyCode == aimbotKeyCode then
                    aimbotActive = false
                    currentTarget = nil
                    UpdateBindButtonText()
                end
            else
                -- Non-keyboard input type ended (e.g., mouse button released)
                aimbotActive = false
                currentTarget = nil
                UpdateBindButtonText()
            end
        end
    end
end)

-- Update mouse position each frame (used for FOV and aiming)
local function UpdateMousePos()
    local mouseLocation = UserInputService:GetMouseLocation()
    mousePos = Vector2.new(mouseLocation.X, mouseLocation.Y)
end

-- Main aimbot update function
local function AimbotStep()
    UpdateMousePos()
    fovDrawing.Position = mousePos
    fovDrawing.Radius = FOVRadius

    -- If StickyAim on AND we already have a locked target that is still valid, keep it
    if StickyAim and currentTarget and currentTarget.Parent and GetScreenPos(currentTarget) then
        -- continue tracking currentTarget
        local targetPos = GetScreenPos(currentTarget)
        if targetPos then
            local delta = (targetPos - mousePos) * AimSpeed
            if mousemoverel then pcall(mousemoverel, delta.X, delta.Y) end
            return
        else
            currentTarget = nil -- lost target
        end
    end

    -- If not sticky or no current target, and aimbot active -> pick closest inside FOV
    if aimbotActive then
        -- find closest
        local chosen = GetClosestTarget()
        if chosen then
            currentTarget = chosen
            local targetPos = GetScreenPos(currentTarget)
            if targetPos then
                local delta = (targetPos - mousePos) * AimSpeed
                if mousemoverel then pcall(mousemoverel, delta.X, delta.Y) end
            else
                currentTarget = nil
            end
        else
            -- no one in FOV
            if not StickyAim then currentTarget = nil end
        end
    else
        -- aimbot not active -> clear currentTarget
        currentTarget = nil
    end
end

-- Choose loop type based on NoSleep
if NoSleep then
    RunService.Heartbeat:Connect(AimbotStep)
else
    RunService.RenderStepped:Connect(AimbotStep)
end

-- initial UI text
UpdateBindButtonText()

Features & Information

Just aimbot toggle aimbot hold aimbot no sleep aimbot sticky aimbot idk made with chat gpt in 10 mins

Community Comments (0)

No comments yet for this script.

More Scripts for Project: SCP