Auto
Key Required

Auto

⚽ Soccer Legends [BETA]TheScripterManTheScripterMan 1.9K views 81 executesUpdated Apr 13, 2026
3.3/ 5(3 votes)
2167% Positive
Lua Script•204 lines (6355 chars)
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local VIM = game:GetService("VirtualInputManager")

local running = false
local keeping = false
local selectedTeam = nil

local startY = nil -- 🔥 store Y for autoscore

-- goal X positions
local HOME_GOAL_X = -387.8507995605469
local AWAY_GOAL_X = -151.8509979248047

-- offsets (your -15 is fine now)
local HOME_KEEP_X = HOME_GOAL_X + 15
local AWAY_KEEP_X = AWAY_GOAL_X - 15

-- goal Y bounds
local GOAL_Y_BOTTOM = 4.25
local GOAL_Y_TOP = 15.25

-- helper
local function getHRP()
    local char = player.Character or player.CharacterAdded:Wait()
    return char:WaitForChild("HumanoidRootPart")
end

local function safeClamp(value, a, b)
    local min = math.min(a, b)
    local max = math.max(a, b)
    return math.clamp(value, min, max)
end

-- GUI
local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
gui.Name = "TeamSelector"

-- =========================
-- 📜 NOTICE GUI (RESTORED)
-- =========================
local noticeFrame = Instance.new("Frame", gui)
noticeFrame.Size = UDim2.new(0, 340, 0, 250)
noticeFrame.Position = UDim2.new(0.5, -170, 0.5, -125)
noticeFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
noticeFrame.BackgroundTransparency = 0.1
noticeFrame.BorderSizePixel = 0

local noticeText = Instance.new("TextLabel", noticeFrame)
noticeText.Size = UDim2.new(1, -20, 1, -50)
noticeText.Position = UDim2.new(0, 10, 0, 10)
noticeText.BackgroundTransparency = 1
noticeText.TextColor3 = Color3.fromRGB(255,255,255)
noticeText.Font = Enum.Font.Gotham
noticeText.TextSize = 13
noticeText.TextWrapped = true
noticeText.TextXAlignment = Enum.TextXAlignment.Left
noticeText.TextYAlignment = Enum.TextYAlignment.Top
noticeText.Text = "Keybinds:\nV - Toggle GUI\nB - Auto Score\nN - Auto Goalkeep\n\nUse ~75 power for consistency.\n125 works when ball is on enemy side.\n\nScript manually scores (no remotes).\nHigh success rate, not perfect."

local noticeClose = Instance.new("TextButton", noticeFrame)
noticeClose.Size = UDim2.new(1, 0, 0, 35)
noticeClose.Position = UDim2.new(0, 0, 1, -35)
noticeClose.BackgroundColor3 = Color3.fromRGB(200,50,50)
noticeClose.Text = "✕ Close"
noticeClose.TextColor3 = Color3.fromRGB(255,255,255)
noticeClose.Font = Enum.Font.GothamBold
noticeClose.TextSize = 14

noticeClose.MouseButton1Click:Connect(function()
    noticeFrame.Visible = false
end)

-- =========================
-- 🎮 TEAM GUI
-- =========================
local frame = Instance.new("Frame", gui)
frame.Size = UDim2.new(0, 200, 0, 145)
frame.Position = UDim2.new(1, -220, 0.5, -72)
frame.BackgroundTransparency = 0.2

local label = Instance.new("TextLabel", frame)
label.Size = UDim2.new(1, 0, 0, 25)
label.BackgroundTransparency = 1
label.Text = "Select your team."
label.TextColor3 = Color3.fromRGB(255,255,255)
label.Font = Enum.Font.GothamBold
label.TextSize = 14

local redBtn = Instance.new("TextButton", frame)
redBtn.Size = UDim2.new(1, 0, 0, 60)
redBtn.Position = UDim2.new(0, 0, 0, 25)
redBtn.Text = "Really Red"

local blueBtn = Instance.new("TextButton", frame)
blueBtn.Size = UDim2.new(1, 0, 0, 60)
blueBtn.Position = UDim2.new(0, 0, 0, 85)
blueBtn.Text = "Really Blue"

redBtn.MouseButton1Click:Connect(function()
    selectedTeam = "Red"
    print("Selected: Red")
end)

blueBtn.MouseButton1Click:Connect(function()
    selectedTeam = "Blue"
    print("Selected: Blue")
end)

-- keybinds
UIS.InputBegan:Connect(function(input, gpe)
    if gpe then return end

    if input.KeyCode == Enum.KeyCode.V then
        frame.Visible = not frame.Visible

    elseif input.KeyCode == Enum.KeyCode.B then
        running = not running
        print("Auto Score:", running)

        if running then
            local hrp = getHRP()
            startY = hrp.Position.Y -- 🔥 store Y when starting
        else
            startY = nil
        end

    elseif input.KeyCode == Enum.KeyCode.N then
        keeping = not keeping
        print("Auto Keep:", keeping)
    end
end)

-- main loop
task.spawn(function()
    while true do
        task.wait(0.01)

        local hrp = getHRP()
        local ball = workspace:FindFirstChild("Balls") and workspace.Balls:FindFirstChild("Ball")
        if not ball then continue end

        local homeGoal = workspace:FindFirstChild("HomeGoal")
        local awayGoal = workspace:FindFirstChild("AwayGoal")
        if not homeGoal or not awayGoal then continue end

        -- 🧤 GOALKEEP
        if keeping and selectedTeam then
            local myGoalX, myKeepX, myGoalZ, facingGoal

            if selectedTeam == "Blue" then
                myGoalX = HOME_GOAL_X
                myKeepX = HOME_KEEP_X
                myGoalZ = homeGoal.Position.Z
                facingGoal = awayGoal
            else
                myGoalX = AWAY_GOAL_X
                myKeepX = AWAY_KEEP_X
                myGoalZ = awayGoal.Position.Z
                facingGoal = homeGoal
            end

            local clampedX = safeClamp(ball.Position.X, myGoalX, myKeepX)
            local clampedZ = math.clamp(ball.Position.Z, myGoalZ - 20, myGoalZ + 20)
            local clampedY = math.clamp(ball.Position.Y, GOAL_Y_BOTTOM, GOAL_Y_TOP)

            local keepPos = Vector3.new(clampedX, clampedY, clampedZ)

            local direction = (Vector3.new(
                facingGoal.Position.X,
                keepPos.Y,
                facingGoal.Position.Z
            ) - keepPos).Unit

            hrp.CFrame = CFrame.new(keepPos, keepPos + direction)

        -- ⚽ AUTOSCORE
        elseif running and selectedTeam then
            if not startY then continue end

            local targetGoal
            if selectedTeam == "Red" then
                targetGoal = homeGoal
            else
                targetGoal = awayGoal
            end

            -- 🔥 lock Y to startY
            local targetPos = Vector3.new(ball.Position.X, startY, ball.Position.Z)

            local direction = (Vector3.new(
                targetGoal.Position.X,
                startY,
                targetGoal.Position.Z
            ) - targetPos).Unit

            hrp.CFrame = CFrame.new(targetPos, targetPos + direction)

            VIM:SendKeyEvent(true, Enum.KeyCode.W, false, game)
            task.wait(0.01)
            VIM:SendKeyEvent(false, Enum.KeyCode.W, false, game)
        end
    end
end)

Features & Information

*Simple autoscore by constantly facing the enemy goal and loop tping. *Simple autogoalkeep Finally fixed autogoalkeep, Enjoy! NO MOBILE SUPPORT, USE MOBILE KEYBOARD One of the only working soccer legends scripts atm.

Community Comments (1)

ZoopaalZoopaalApr 13, 2026

* i swear i fckin love u

More Scripts for ⚽ Soccer Legends [BETA]