open source
Key Required

open source

SpongeBob Simulatoryogurt888888yogurt888888 1.4K views 109 executesUpdated Feb 24, 2026
3.3/ 5(3 votes)
2167% Positive
Lua Script•1107 lines (37374 chars)
--[[
    SPONGEBOB SIMULATOR — SpongeMobile v9.2 RACE FLASH & BOAT FIX
    ═══════════════════════════════════════════════════════════
    • Auto Race: attesa 0.5s dopo start per evitare flash spawn
    • Dopo ExitRace: guardiano persistente per 2.5s (solo se barca attiva)
    • Disattivazione forzata dopo 2.9s (param true)
    • Auto Pedestals: timeout 0.8s, pausa 0.02s (veloce)
    • Auto Hatch: reattivo con hatchSession
]]

local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local WS = game:GetService("Workspace")
local TS = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")
local Lighting = game:GetService("Lighting")
local SS = game:GetService("ServerStorage")

local player = Players.LocalPlayer

-- ==================== FLAG GLOBALE ====================
local SCRIPT_ACTIVE = true

-- ==================== UTILITÀ ====================
local function clamp(x, a, b) return math.max(a, math.min(b, x)) end
local function getHRP() local c = player.Character return c and c:FindFirstChild("HumanoidRootPart") end
local function getHum() local c = player.Character return c and c:FindFirstChildOfClass("Humanoid") end

-- ==================== STATI ====================
local St = {
    autoAttack  = false,
    autoCollect = false,
    autoBoss    = false,
    autoPed     = false,
    autoHatch   = false,
    autoRace    = false,
    autoCook    = false,
    raceSpeed   = 5,
    raceTrack   = 1,
}
local selectedEgg = nil
local hatchAmt = 1
local selectedZone = nil

-- ==================== REMOTES ====================
local Knit = RS:FindFirstChild("Knit")
local KSvc = Knit and Knit:FindFirstChild("Services")
local HatchRF, NodeRE, RaceRF, StartRaceRF, ExitRace, ToggleMountRF, CookingRF
local MountRE

local function findRemotes()
    if KSvc then
        local clamSvc = KSvc:FindFirstChild("ClamService")
        if clamSvc then local rf = clamSvc:FindFirstChild("RF") if rf then HatchRF = rf:FindFirstChild("Purchase") or rf:FindFirstChild("Hatch") end end
        local nodeSvc = KSvc:FindFirstChild("NodeService")
        if nodeSvc then local re = nodeSvc:FindFirstChild("RE") if re then NodeRE = re:FindFirstChild("NodeClicked") end end
        local raceSvc = KSvc:FindFirstChild("RaceService")
        if raceSvc then RaceRF = raceSvc:FindFirstChild("RF") if RaceRF then StartRaceRF = RaceRF:FindFirstChild("StartTimeTrial") ExitRace = RaceRF:FindFirstChild("ExitRace") end end
        local mountSvc = KSvc:FindFirstChild("MountService")
        if mountSvc then
            local rf = mountSvc:FindFirstChild("RF") if rf then ToggleMountRF = rf:FindFirstChild("Toggle") end
            local re = mountSvc:FindFirstChild("RE") if re then MountRE = re:FindFirstChild("MountStateChanged") end
        end
        local cookSvc = KSvc:FindFirstChild("CookingService")
        if cookSvc then local rf = cookSvc:FindFirstChild("RF") if rf then CookingRF = rf:FindFirstChild("Cook") end end
    end
    if not HatchRF then for _, o in ipairs(RS:GetDescendants()) do if o:IsA("RemoteFunction") and (o.Name == "Purchase" or o.Name == "Hatch") then HatchRF = o break end end end
    if not NodeRE then for _, o in ipairs(RS:GetDescendants()) do if o:IsA("RemoteEvent") and o.Name == "NodeClicked" then NodeRE = o break end end end
    if not CookingRF then for _, o in ipairs(RS:GetDescendants()) do if o:IsA("RemoteFunction") and o.Name == "Cook" then CookingRF = o break end end end
end
findRemotes()

-- ==================== ANTI-BOAT (STATE TRACKER) ====================
local isBoatMounted = false

if MountRE then
    MountRE.OnClientEvent:Connect(function(...)
        local args = {...}
        local mountName = tostring(args[2] or ""):lower()
        local state = tostring(args[3] or ""):lower()
        if mountName:find("boat") then
            isBoatMounted = (state == "mounted")
        end
    end)
    print("✅ Anti-Boat state tracker attivo")
end

local function ensureBoatOff()
    if not ToggleMountRF then return false end
    pcall(function() ToggleMountRF:InvokeServer(true) end)
    task.wait(0.1)
    return true
end

-- Guardiano post‑uscita: continua a disattivare finché la barca è montata (max 2.5s)
local function forceBoatOffAfterExit()
    if not isBoatMounted then return end
    local start = tick()
    while tick() - start < 2.5 and isBoatMounted and SCRIPT_ACTIVE do
        pcall(function() ToggleMountRF:InvokeServer(true) end)
        task.wait(0.2)
    end
end

-- ==================== EGG SCAN ====================
task.wait(2)
local function validEgg(n)
    local l = n:lower()
    local num = l:match("^area(%d+)")
    if num then local rest = l:sub(#("area"..num)+2) if rest == "basic" or rest == "gold" or rest == "golden" then return true end end
    return l == "meme buddies" or l:match("^secret zone%d*") ~= nil
end
local eggs = {}
do
    local seen = {}
    for _, place in ipairs({WS, RS, Lighting, SS}) do
        for _, obj in ipairs(place:GetDescendants()) do
            if obj:IsA("Model") and validEgg(obj.Name) and not seen[obj.Name] then
                seen[obj.Name] = true
                table.insert(eggs, obj.Name)
            end
        end
    end
    table.sort(eggs)
    if #eggs == 0 then eggs = {"area1 basic","area1 golden","area2 basic","area2 golden","area3 basic","area3 golden","area4 basic","area4 golden","meme buddies","secret zone2","secret zone4"} end
end
selectedEgg = eggs[1]

-- ==================== ZONE SCAN ====================
local zoneData  = {}
local zoneNames = {}
do
    local prog = WS:FindFirstChild("Programmables")
    local collectibles = prog and prog:FindFirstChild("Collectibles")
    if collectibles then
        for _, zoneFolder in ipairs(collectibles:GetChildren()) do
            if zoneFolder:IsA("Folder") or zoneFolder:IsA("Model") then
                local pedestals = {}
                for _, descendant in ipairs(zoneFolder:GetDescendants()) do
                    if descendant:IsA("BasePart") or descendant:IsA("MeshPart") or descendant:IsA("Part") then
                        table.insert(pedestals, descendant)
                    end
                end
                if #pedestals > 0 then
                    zoneData[zoneFolder.Name] = pedestals
                    table.insert(zoneNames, zoneFolder.Name)
                end
            end
        end
    end
    table.sort(zoneNames, function(a,b) return (tonumber(a:match("%d+")) or 0) < (tonumber(b:match("%d+")) or 0) end)
    print("Zones: " .. #zoneNames)
end

-- ==================== AUTO ATTACK ====================
task.spawn(function()
    while SCRIPT_ACTIVE do
        if St.autoAttack and NodeRE then
            pcall(function()
                local hrp = getHRP() if not hrp then return end
                local nodes = WS:FindFirstChild("Nodes")
                if nodes then
                    local best, bd = nil, 150
                    for _, n in pairs(nodes:GetChildren()) do
                        if n:IsA("BasePart") then
                            local d = (n.Position - hrp.Position).Magnitude
                            if d < bd then bd = d best = n end
                        end
                    end
                    if best then NodeRE:FireServer(best, true, false) end
                end
            end)
        end
        task.wait(0.25)
    end
end)

-- ==================== AUTO COLLECT ====================
task.spawn(function()
    local cache = {}
    while SCRIPT_ACTIVE do
        if St.autoCollect then
            pcall(function()
                local hrp = getHRP() if not hrp then return end
                local terrain = WS:FindFirstChild("Terrain")
                if terrain then
                    for _, child in pairs(terrain:GetChildren()) do
                        if child:IsA("Attachment") and child.Name:match("^Currency") and not cache[child] then
                            cache[child] = true
                            child.WorldPosition = hrp.Position
                            task.delay(0.3, function() cache[child] = nil end)
                        end
                    end
                end
            end)
        end
        task.wait(0.15)
    end
end)

-- ==================== AUTO BOSS ====================
local bossSpawns = {}
do
    local prog = WS:FindFirstChild("Programmables")
    local sp = prog and prog:FindFirstChild("BossPartSpawners")
    if sp then
        for _, w in ipairs({"GooLagoon","Mermalair","VacationWorld"}) do
            local f = sp:FindFirstChild(w)
            if f then for _, o in ipairs(f:GetDescendants()) do if o:IsA("BasePart") then table.insert(bossSpawns, o.Position) break end end end
        end
    end
end
task.spawn(function()
    local col, tele, last = {}, false, nil
    while SCRIPT_ACTIVE do
        if St.autoBoss and not tele then
            pcall(function()
                local hrp = getHRP() if not hrp then return end
                local terrain = WS:FindFirstChild("Terrain") if not terrain then return end
                for _, o in pairs(terrain:GetChildren()) do
                    if o:IsA("Attachment") and o.Name:match("^Item") and not col[o] then
                        local pos = o.WorldPosition
                        local isBoss = false
                        for _, sp in ipairs(bossSpawns) do if (pos - sp).Magnitude < 120 then isBoss = true break end end
                        if isBoss then
                            col[o] = true tele = true last = hrp.CFrame
                            hrp.CFrame = CFrame.new(pos + Vector3.new(0,3,0))
                            task.wait(0.3)
                            if last then hrp.CFrame = last end
                            tele = false
                            task.delay(15, function() col[o] = nil end)
                            break
                        else
                            col[o] = true
                            task.delay(5, function() col[o] = nil end)
                        end
                    end
                end
            end)
        end
        task.wait(0.15)
    end
end)

-- ==================== AUTO PEDESTALS (VELOCIZZATO) ====================
local PED = { running = false }

local function getPedsForZone()
    if selectedZone and zoneData[selectedZone] then
        return zoneData[selectedZone]
    end
    local all = {}
    for _, zn in ipairs(zoneNames) do
        for _, ped in ipairs(zoneData[zn]) do
            table.insert(all, ped)
        end
    end
    return all
end

local function isPedestalCollected(ped)
    if not ped or not ped.Parent then return true end
    if ped:IsA("BasePart") and not ped.CanCollide and ped.Transparency > 0.9 then
        return true
    end
    return false
end

local function triggerPedestal(ped)
    local cd = ped:FindFirstChildOfClass("ClickDetector")
    local pp = ped:FindFirstChildOfClass("ProximityPrompt")
    if cd then
        pcall(fireclickdetector, cd)
    elseif pp then
        pcall(fireproximityprompt, pp)
    end
end

local function processPedestal(ped, hrp)
    if not ped or not ped.Parent then return end

    local dist = (hrp.Position - ped.Position).Magnitude
    if dist > 10 then
        hrp.AssemblyLinearVelocity = Vector3.zero
        hrp.AssemblyAngularVelocity = Vector3.zero
        hrp.CFrame = CFrame.new(ped.Position + Vector3.new(0, 4, 0))
        task.wait(0.05)
    end

    triggerPedestal(ped)

    local t = tick()
    local retried = false
    while tick() - t < 0.8 do
        if not SCRIPT_ACTIVE or not PED.running or not St.autoPed then return end
        if isPedestalCollected(ped) then return end
        task.wait(0.1)
        if not retried and tick() - t >= 0.15 then
            triggerPedestal(ped)
            retried = true
        end
    end
end

local function startPedestals()
    if PED.running then return end
    PED.running = true
    task.spawn(function()
        local processed = {}
        local lastZone = nil
        local peds = getPedsForZone()

        while SCRIPT_ACTIVE and PED.running and St.autoPed do
            local hrp = getHRP()
            if not hrp then task.wait(0.2) continue end

            if selectedZone ~= lastZone then
                peds = getPedsForZone()
                processed = {}
                lastZone = selectedZone
            end

            if #peds == 0 then task.wait(0.5) continue end

            local target = nil
            for _, p in ipairs(peds) do
                if p and p.Parent and not processed[p] and not isPedestalCollected(p) then
                    target = p
                    break
                end
            end

            if not target then
                processed = {}
                peds = getPedsForZone()
                task.wait(0.2)
                continue
            end

            processed[target] = true
            processPedestal(target, hrp)
            task.wait(0.02)
        end
        PED.running = false
    end)
end

local function stopPedestals()
    PED.running = false
    St.autoPed = false
    local hrp = getHRP()
    if hrp then hrp.Anchored = false end
end

-- ==================== AUTO HATCH (REATTIVO) ====================
local hatchSession = 0
local HATCH_COOLDOWN = 3.6

local function findIncubator()
    local incubatorFolder = WS:FindFirstChild("Incubators") or WS:FindFirstChild("EggMachines")
    if incubatorFolder then
        for _, obj in ipairs(incubatorFolder:GetChildren()) do
            if obj:IsA("BasePart") then return obj end
        end
    end
    for _, obj in ipairs(WS:GetDescendants()) do
        if obj:IsA("ClickDetector") or obj:IsA("ProximityPrompt") then
            local parent = obj.Parent
            if parent and parent:IsA("BasePart") and parent.Name:lower():find("hatch") then
                return parent
            end
        end
    end
    return nil
end

local function startHatch()
    if not HatchRF then
        findRemotes()
        if not HatchRF then
            warn("Hatch remote not found")
            return
        end
    end

    hatchSession = hatchSession + 1
    local currentSession = hatchSession

    task.spawn(function()
        while St.autoHatch and currentSession == hatchSession and SCRIPT_ACTIVE do
            if not selectedEgg then
                task.wait(0.2)
                continue
            end

            local incubator = findIncubator()
            if incubator then
                local hrp = getHRP()
                if hrp then
                    hrp.CFrame = incubator.CFrame * CFrame.new(0, 3, 0)
                    task.wait(0.15)
                end
            end

            local ok = pcall(function()
                HatchRF:InvokeServer(selectedEgg, hatchAmt)
            end)

            if ok then
                local gui = player:FindFirstChildOfClass("PlayerGui")
                if gui then
                    local anim = gui:FindFirstChild("HatchAnimation")
                    if anim then anim:Destroy() end
                end
                task.wait(HATCH_COOLDOWN)
            else
                task.wait(1)
            end
        end
    end)
end

local function stopHatch()
    St.autoHatch = false
    hatchSession = hatchSession + 1
end

-- ==================== AUTO COOK ====================
local cookActive = false
local function cookLoop()
    while SCRIPT_ACTIVE and cookActive and St.autoCook do
        if CookingRF then
            pcall(function() CookingRF:InvokeServer("KetchupKrabbyPatty", 1, 0.9422856171925863) end)
        else
            findRemotes()
        end
        task.wait(2)
    end
    cookActive = false
end
local function startCook() if cookActive then return end if not CookingRF then findRemotes() end if not CookingRF then return end cookActive = true task.spawn(cookLoop) end
local function stopCook() St.autoCook = false cookActive = false end

-- ==================== AUTO RACE (FLASH FIX + POST‑EXIT GUARD) ====================
local TRACKS = { [1] = "boat school", [2] = "fry cook coliseum" }
local RaceActive = false
local StopRequested = false

local function getCheckpoints(trackName)
    local prog = WS:FindFirstChild("Programmables")
    local races = prog and prog:FindFirstChild("Races")
    local track = races and races:FindFirstChild(trackName)
    local cpFolder = track and track:FindFirstChild("Checkpoints")
    if not cpFolder then return {} end
    local map = {}
    for _, v in ipairs(cpFolder:GetChildren()) do
        if v:IsA("BasePart") or v:IsA("MeshPart") then
            local num = tonumber(v.Name)
            if num then map[num] = v end
        end
    end
    local ordered = {}
    for i = 1, #map do if map[i] then table.insert(ordered, map[i]) end end
    return ordered
end

local function touchCheckpoint(part)
    local char = player.Character
    if not char then return end
    for _, p in ipairs(char:GetDescendants()) do
        if p:IsA("BasePart") then
            pcall(function()
                firetouchinterest(p, part, 0)
                firetouchinterest(p, part, 1)
            end)
        end
    end
end

local function secureTouch(part)
    for _ = 1, 3 do touchCheckpoint(part) task.wait(0.04) end
    task.wait(0.05)
end

local function raceLoop()
    while SCRIPT_ACTIVE and RaceActive and not StopRequested do
        local trackName = TRACKS[St.raceTrack]
        if not trackName then task.wait(2) continue end

        pcall(function() StartRaceRF:InvokeServer(trackName) end)
        
        -- 🔥 ATTESA BREVE PER PERMETTERE AL SERVER DI TELEPORTARCI SULLA PISTA
        task.wait(0.5)

        -- Disattiva subito per sicurezza
        ensureBoatOff()
        task.wait(2.9)

        -- 🔥 DISATTIVAZIONE FORZATA dopo countdown
        pcall(function() ToggleMountRF:InvokeServer(true) end)
        task.wait(2.8)

        local cps = getCheckpoints(trackName)
        if #cps == 0 then task.wait(2) continue end

        for lap = 1, 3 do
            if not SCRIPT_ACTIVE or not RaceActive or StopRequested then break end
            for _, cp in ipairs(cps) do
                if not SCRIPT_ACTIVE or not RaceActive or StopRequested then break end
                local hrp = getHRP()
                if hrp then
                    hrp.AssemblyLinearVelocity = Vector3.zero
                    hrp.AssemblyAngularVelocity = Vector3.zero
                    hrp.CFrame = CFrame.new(cp.Position + Vector3.new(0,5,0))
                    task.wait(0.03)
                end
                secureTouch(cp)
                local delay = math.max(0.01, (26 - clamp(St.raceSpeed, 1, 25)) * 0.020)
                task.wait(delay)
            end
        end

        if cps[1] then
            local hrp = getHRP()
            if hrp then hrp.CFrame = CFrame.new(cps[1].Position + Vector3.new(0,5,0)) task.wait(0.03) end
            secureTouch(cps[1])
            task.wait(0.6)
        end

        pcall(function() ExitRace:InvokeServer() end)
        
        -- 🔥 GUARDIANO POST‑USCITA: continua a disattivare se la barca è montata
        forceBoatOffAfterExit()
    end
    RaceActive = false
    StopRequested = false
end

local function startRace()
    if RaceActive then return end
    RaceActive = true
    StopRequested = false
    task.spawn(raceLoop)
end

local function stopRace()
    StopRequested = true
    RaceActive = false
end

-- ==================== GUI VIOLA (INVARIATA) ====================
local PGui = player:WaitForChild("PlayerGui")
for _, g in pairs(PGui:GetChildren()) do
    if g:IsA("ScreenGui") and g.Name == "SpongeMobile" then g:Destroy() end
end

local C = {
    Bg    = Color3.fromRGB(18, 18, 24),
    Glass = Color3.fromRGB(36, 36, 46),
    Acc   = Color3.fromRGB(130, 40, 220),
    AccL  = Color3.fromRGB(165, 80, 255),
    Txt   = Color3.fromRGB(255, 255, 255),
    Off   = Color3.fromRGB(52, 52, 64),
    On    = Color3.fromRGB(130, 40, 220),
    Green = Color3.fromRGB(0, 205, 105),
    Sub   = Color3.fromRGB(24, 24, 34),
    Red   = Color3.fromRGB(205, 50, 50),
    Gold  = Color3.fromRGB(215, 175, 0),
}

local gui = Instance.new("ScreenGui")
gui.Name = "SpongeMobile"
gui.ResetOnSpawn = false
gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
gui.Parent = PGui

local main = Instance.new("Frame")
main.Size = UDim2.new(0, 240, 0, 440)
main.Position = UDim2.new(0, 10, 0.5, -220)
main.BackgroundColor3 = C.Bg
main.BackgroundTransparency = 0.04
main.BorderSizePixel = 0
main.Active = true
main.ClipsDescendants = true
main.Parent = gui
Instance.new("UICorner", main).CornerRadius = UDim.new(0, 12)
local mainStroke = Instance.new("UIStroke", main)
mainStroke.Color = C.Acc
mainStroke.Transparency = 0.5
mainStroke.Thickness = 1

-- Header
local hdr = Instance.new("Frame", main)
hdr.Size = UDim2.new(1, 0, 0, 34)
hdr.BackgroundColor3 = C.Acc
hdr.BackgroundTransparency = 0.05
hdr.BorderSizePixel = 0
Instance.new("UICorner", hdr).CornerRadius = UDim.new(0, 12)

local htitle = Instance.new("TextLabel", hdr)
htitle.Size = UDim2.new(1, -64, 1, 0)
htitle.Position = UDim2.new(0, 10, 0, 0)
htitle.Text = "SPONGE SIM v9.2"
htitle.TextColor3 = C.Txt
htitle.Font = Enum.Font.GothamBold
htitle.TextSize = 10
htitle.TextXAlignment = Enum.TextXAlignment.Left
htitle.BackgroundTransparency = 1

local function mkHBtn(xo, txt, bg)
    local b = Instance.new("TextButton", hdr)
    b.Size = UDim2.new(0, 26, 0, 26)
    b.Position = UDim2.new(1, xo, 0, 4)
    b.Text = txt
    b.TextColor3 = C.Txt
    b.Font = Enum.Font.GothamBold
    b.TextSize = 15
    b.BackgroundColor3 = bg
    b.BackgroundTransparency = 0.1
    b.BorderSizePixel = 0
    Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6)
    return b
end

local minBtn = mkHBtn(-70, "-", C.Glass)
local closeBtn = mkHBtn(-40, "x", C.Red)
local isMin = false
local fullSize = UDim2.new(0, 240, 0, 440)
local miniSize = UDim2.new(0, 240, 0, 34)

minBtn.MouseButton1Click:Connect(function()
    isMin = not isMin
    TS:Create(main, TweenInfo.new(0.2), {Size = isMin and miniSize or fullSize}):Play()
    minBtn.Text = isMin and "+" or "-"
end)

closeBtn.MouseButton1Click:Connect(function()
    SCRIPT_ACTIVE = false
    stopHatch()
    stopRace()
    stopPedestals()
    stopCook()
    gui:Destroy()
end)

-- Drag
local dragging, dragStart, dragPosition = false, nil, nil
hdr.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        dragPosition = main.Position
        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then dragging = false end
        end)
    end
end)
UIS.InputChanged:Connect(function(input)
    if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
        local delta = input.Position - dragStart
        main.Position = UDim2.new(dragPosition.X.Scale, dragPosition.X.Offset + delta.X, dragPosition.Y.Scale, dragPosition.Y.Offset + delta.Y)
    end
end)

-- Scroll
local scr = Instance.new("ScrollingFrame", main)
scr.Size = UDim2.new(1, -4, 1, -36)
scr.Position = UDim2.new(0, 2, 0, 35)
scr.BackgroundTransparency = 1
scr.ScrollBarThickness = 3
scr.ScrollBarImageColor3 = C.Acc
scr.ScrollBarImageTransparency = 0.4
scr.CanvasSize = UDim2.new(0, 0, 0, 0)
scr.AutomaticCanvasSize = Enum.AutomaticSize.Y
scr.ScrollingDirection = Enum.ScrollingDirection.Y
scr.ElasticBehavior = Enum.ElasticBehavior.Always

local lay = Instance.new("UIListLayout", scr)
lay.Padding = UDim.new(0, 3)
lay.SortOrder = Enum.SortOrder.LayoutOrder
lay.HorizontalAlignment = Enum.HorizontalAlignment.Center

local uipad = Instance.new("UIPadding", scr)
uipad.PaddingTop = UDim.new(0, 4)
uipad.PaddingLeft = UDim.new(0, 5)
uipad.PaddingRight = UDim.new(0, 5)
uipad.PaddingBottom = UDim.new(0, 10)

local lo = 0
local function nlo() lo = lo + 1 return lo end

local function div(txt)
    local f = Instance.new("Frame")
    f.Size = UDim2.new(1, 0, 0, 18)
    f.BackgroundTransparency = 1
    f.LayoutOrder = nlo()
    f.Parent = scr
    local line = Instance.new("Frame", f)
    line.Size = UDim2.new(1, 0, 0, 1)
    line.Position = UDim2.new(0, 0, 0, 0)
    line.BackgroundColor3 = C.Acc
    line.BackgroundTransparency = 0.6
    line.BorderSizePixel = 0
    local l = Instance.new("TextLabel", f)
    l.Size = UDim2.new(1, 0, 0, 16)
    l.Position = UDim2.new(0, 0, 0, 2)
    l.Text = txt
    l.TextColor3 = C.AccL
    l.Font = Enum.Font.GothamBold
    l.TextSize = 9
    l.TextXAlignment = Enum.TextXAlignment.Left
    l.BackgroundTransparency = 1
end

local function mkToggle(txt, key, onOn, onOff)
    local c = Instance.new("Frame")
    c.Size = UDim2.new(1, 0, 0, 32)
    c.BackgroundColor3 = C.Glass
    c.BackgroundTransparency = 0.4
    c.BorderSizePixel = 0
    c.LayoutOrder = nlo()
    c.Parent = scr
    Instance.new("UICorner", c).CornerRadius = UDim.new(0, 8)

    local lbl = Instance.new("TextLabel", c)
    lbl.Size = UDim2.new(1, -52, 1, 0)
    lbl.Position = UDim2.new(0, 10, 0, 0)
    lbl.Text = txt
    lbl.TextColor3 = C.Txt
    lbl.Font = Enum.Font.GothamSemibold
    lbl.TextSize = 10
    lbl.TextXAlignment = Enum.TextXAlignment.Left
    lbl.BackgroundTransparency = 1

    local sw = Instance.new("TextButton", c)
    sw.Size = UDim2.new(0, 38, 0, 20)
    sw.Position = UDim2.new(1, -44, 0.5, -10)
    sw.BackgroundColor3 = C.Off
    sw.Text = ""
    sw.AutoButtonColor = false
    sw.BorderSizePixel = 0
    Instance.new("UICorner", sw).CornerRadius = UDim.new(1, 0)

    local dot = Instance.new("Frame", sw)
    dot.Size = UDim2.new(0, 14, 0, 14)
    dot.Position = UDim2.new(0, 3, 0.5, -7)
    dot.BackgroundColor3 = Color3.fromRGB(235, 235, 235)
    Instance.new("UICorner", dot).CornerRadius = UDim.new(1, 0)

    sw.MouseButton1Click:Connect(function()
        St[key] = not St[key]
        local on = St[key]
        TS:Create(sw, TweenInfo.new(0.18), {BackgroundColor3 = on and C.On or C.Off}):Play()
        TS:Create(dot, TweenInfo.new(0.18), {Position = on and UDim2.new(1, -17, 0.5, -7) or UDim2.new(0, 3, 0.5, -7)}):Play()
        if on and onOn then onOn() elseif not on and onOff then onOff() end
    end)
end

local function mkDropdown(par, items, ph, onSel)
    local wrap = Instance.new("Frame")
    wrap.Size = UDim2.new(1, 0, 0, 28)
    wrap.BackgroundTransparency = 1
    wrap.ClipsDescendants = false
    wrap.LayoutOrder = nlo()
    wrap.Parent = par

    local btn = Instance.new("TextButton", wrap)
    btn.Size = UDim2.new(1, 0, 0, 28)
    btn.BackgroundColor3 = C.Glass
    btn.BackgroundTransparency = 0.35
    btn.TextColor3 = C.Txt
    btn.Font = Enum.Font.GothamSemibold
    btn.TextSize = 10
    btn.Text = ph
    btn.BorderSizePixel = 0
    Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 7)

    local ar = Instance.new("TextLabel", btn)
    ar.Size = UDim2.new(0, 18, 1, 0)
    ar.Position = UDim2.new(1, -22, 0, 0)
    ar.Text = "v"
    ar.TextColor3 = C.AccL
    ar.Font = Enum.Font.GothamBold
    ar.TextSize = 9
    ar.BackgroundTransparency = 1

    local lH = math.min(#items * 26 + 4, 150)
    local list = Instance.new("ScrollingFrame", wrap)
    list.Size = UDim2.new(1, 0, 0, 0)
    list.Position = UDim2.new(0, 0, 0, 30)
    list.BackgroundColor3 = Color3.fromRGB(16, 16, 24)
    list.BackgroundTransparency = 0.05
    list.BorderSizePixel = 0
    list.ScrollBarThickness = 3
    list.ScrollBarImageColor3 = C.Acc
    list.CanvasSize = UDim2.new(0, 0, 0, #items * 26)
    list.Visible = false
    list.ZIndex = 10
    Instance.new("UICorner", list).CornerRadius = UDim.new(0, 7)
    Instance.new("UIListLayout", list).Padding = UDim.new(0, 2)

    local isO = false
    local function setO(o)
        isO = o
        wrap.Size = o and UDim2.new(1, 0, 0, 28 + lH + 4) or UDim2.new(1, 0, 0, 28)
        list.Size = o and UDim2.new(1, 0, 0, lH) or UDim2.new(1, 0, 0, 0)
        list.Visible = o
        ar.Text = o and "^" or "v"
    end
    btn.MouseButton1Click:Connect(function() setO(not isO) end)

    for _, it in ipairs(items) do
        local ib = Instance.new("TextButton", list)
        ib.Size = UDim2.new(1, -6, 0, 24)
        ib.BackgroundColor3 = C.Glass
        ib.BackgroundTransparency = 0.55
        ib.TextColor3 = C.Txt
        ib.Font = Enum.Font.Gotham
        ib.TextSize = 9
        ib.Text = it
        ib.BorderSizePixel = 0
        ib.ZIndex = 11
        Instance.new("UICorner", ib).CornerRadius = UDim.new(0, 5)
        ib.MouseButton1Click:Connect(function()
            btn.Text = #it > 24 and it:sub(1, 24).."…" or it
            setO(false)
            if onSel then onSel(it) end
        end)
    end
end

-- COSTRUZIONE GUI
div("COMBAT")
mkToggle("Auto Attack", "autoAttack")
mkToggle("Auto Collect", "autoCollect")
mkToggle("Auto Boss Parts", "autoBoss")

div("PEDESTALS")
mkToggle("Auto Pedestals", "autoPed", function() startPedestals() end, function() stopPedestals() end)

local zi = {}
if #zoneNames > 1 then table.insert(zi, "All Zones") end
for _, z in ipairs(zoneNames) do table.insert(zi, z) end
if #zi == 0 then table.insert(zi, "No zones") end
mkDropdown(scr, zi, "Select Zone", function(it)
    selectedZone = (it == "All Zones") and nil or it
end)

div("HATCH")
mkToggle("Auto Hatch", "autoHatch", function() startHatch() end, function() stopHatch() end)
mkDropdown(scr, eggs, "Select Egg", function(it) selectedEgg = it end)

local amtF = Instance.new("Frame")
amtF.Size = UDim2.new(1, 0, 0, 26)
amtF.BackgroundTransparency = 1
amtF.LayoutOrder = nlo()
amtF.Parent = scr

local amtBtns = {}
for i, amt in ipairs({1, 3, 8}) do
    local ab = Instance.new("TextButton", amtF)
    ab.Size = UDim2.new(0.32, -4, 1, 0)
    ab.Position = UDim2.new((i-1)*0.34, 0, 0, 0)
    ab.Text = "x"..amt
    ab.TextColor3 = C.Txt
    ab.Font = Enum.Font.GothamBold
    ab.TextSize = 10
    ab.BackgroundColor3 = amt == 1 and C.Acc or C.Off
    ab.BackgroundTransparency = amt == 1 and 0.15 or 0.5
    ab.BorderSizePixel = 0
    Instance.new("UICorner", ab).CornerRadius = UDim.new(0, 12)
    amtBtns[i] = ab
    ab.MouseButton1Click:Connect(function()
        hatchAmt = amt
        for _, b in ipairs(amtBtns) do
            TS:Create(b, TweenInfo.new(0.15), {BackgroundColor3 = C.Off, BackgroundTransparency = 0.5}):Play()
        end
        TS:Create(ab, TweenInfo.new(0.15), {BackgroundColor3 = C.Acc, BackgroundTransparency = 0.15}):Play()
    end)
end

-- Quick Egg
local qSub = Instance.new("Frame")
qSub.Size = UDim2.new(1, 0, 0, 56)
qSub.BackgroundColor3 = C.Sub
qSub.BackgroundTransparency = 0.25
qSub.BorderSizePixel = 0
qSub.LayoutOrder = nlo()
qSub.Parent = scr
Instance.new("UICorner", qSub).CornerRadius = UDim.new(0, 7)

local qTitle = Instance.new("TextLabel", qSub)
qTitle.Size = UDim2.new(1, -8, 0, 16)
qTitle.Position = UDim2.new(0, 6, 0, 2)
qTitle.Text = "Quick Egg Select"
qTitle.TextColor3 = Color3.fromRGB(150, 150, 190)
qTitle.Font = Enum.Font.GothamSemibold
qTitle.TextSize = 8
qTitle.TextXAlignment = Enum.TextXAlignment.Left
qTitle.BackgroundTransparency = 1

local qIn = Instance.new("TextBox", qSub)
qIn.Size = UDim2.new(0, 44, 0, 22)
qIn.Position = UDim2.new(0, 6, 0, 20)
qIn.PlaceholderText = "Area#"
qIn.Text = ""
qIn.BackgroundColor3 = Color3.fromRGB(14, 14, 22)
qIn.BackgroundTransparency = 0.1
qIn.TextColor3 = C.Txt
qIn.PlaceholderColor3 = Color3.fromRGB(80, 80, 100)
qIn.Font = Enum.Font.Gotham
qIn.TextSize = 10
qIn.ClearTextOnFocus = false
Instance.new("UICorner", qIn).CornerRadius = UDim.new(0, 5)

local qMode = Instance.new("TextButton", qSub)
qMode.Size = UDim2.new(0, 52, 0, 22)
qMode.Position = UDim2.new(0, 54, 0, 20)
qMode.Text = "Basic"
qMode.BackgroundColor3 = C.Acc
qMode.BackgroundTransparency = 0.15
qMode.TextColor3 = C.Txt
qMode.Font = Enum.Font.GothamBold
qMode.TextSize = 9
qMode.BorderSizePixel = 0
Instance.new("UICorner", qMode).CornerRadius = UDim.new(0, 5)

local qDisp = Instance.new("TextLabel", qSub)
qDisp.Size = UDim2.new(1, -8, 0, 12)
qDisp.Position = UDim2.new(0, 6, 0, 44)
qDisp.Text = ""
qDisp.TextColor3 = C.AccL
qDisp.Font = Enum.Font.Gotham
qDisp.TextSize = 8
qDisp.TextXAlignment = Enum.TextXAlignment.Left
qDisp.BackgroundTransparency = 1

local qCurMode = "basic"
local function updateQuick()
    local n = tonumber(qIn.Text)
    if n then
        local cand = "area"..n.." "..qCurMode
        local found = false
        for _, e in ipairs(eggs) do
            if e:lower() == cand:lower() then
                selectedEgg = e
                qDisp.Text = "OK: "..e
                qDisp.TextColor3 = C.Green
                found = true
                break
            end
        end
        if not found then
            selectedEgg = nil
            qDisp.Text = "Not found"
            qDisp.TextColor3 = Color3.fromRGB(255, 100, 100)
        end
    end
end
qIn.FocusLost:Connect(function(e) if e then updateQuick() end end)
qMode.MouseButton1Click:Connect(function()
    if qCurMode == "basic" then
        qCurMode = "golden"
        qMode.Text = "Golden"
        qMode.BackgroundColor3 = C.Gold
    else
        qCurMode = "basic"
        qMode.Text = "Basic"
        qMode.BackgroundColor3 = C.Acc
    end
    updateQuick()
end)

div("RACE")
mkToggle("Auto Race", "autoRace", function() startRace() end, function() stopRace() end)

local rSub = Instance.new("Frame")
rSub.Size = UDim2.new(1, 0, 0, 30)
rSub.BackgroundColor3 = C.Sub
rSub.BackgroundTransparency = 0.25
rSub.BorderSizePixel = 0
rSub.LayoutOrder = nlo()
rSub.Parent = scr
Instance.new("UICorner", rSub).CornerRadius = UDim.new(0, 7)

local rLbl = Instance.new("TextLabel", rSub)
rLbl.Size = UDim2.new(0.4, 0, 1, 0)
rLbl.Position = UDim2.new(0, 8, 0, 0)
rLbl.Text = "Race Area"
rLbl.TextColor3 = C.Txt
rLbl.Font = Enum.Font.GothamSemibold
rLbl.TextSize = 10
rLbl.TextXAlignment = Enum.TextXAlignment.Left
rLbl.BackgroundTransparency = 1

local rb1 = Instance.new("TextButton", rSub)
rb1.Size = UDim2.new(0, 30, 0, 22)
rb1.Position = UDim2.new(0.42, 0, 0.5, -11)
rb1.Text = "1"
rb1.TextColor3 = C.Txt
rb1.TextSize = 11
rb1.Font = Enum.Font.GothamBold
rb1.BackgroundColor3 = C.Green
rb1.BorderSizePixel = 0
Instance.new("UICorner", rb1).CornerRadius = UDim.new(0, 6)

local rb2 = Instance.new("TextButton", rSub)
rb2.Size = UDim2.new(0, 30, 0, 22)
rb2.Position = UDim2.new(0.42, 34, 0.5, -11)
rb2.Text = "2"
rb2.TextColor3 = C.Txt
rb2.TextSize = 11
rb2.Font = Enum.Font.GothamBold
rb2.BackgroundColor3 = C.Off
rb2.BorderSizePixel = 0
Instance.new("UICorner", rb2).CornerRadius = UDim.new(0, 6)

rb1.MouseButton1Click:Connect(function()
    St.raceTrack = 1
    rb1.BackgroundColor3 = C.Green
    rb2.BackgroundColor3 = C.Off
    if St.autoRace then stopRace() task.wait(0.3) startRace() end
end)
rb2.MouseButton1Click:Connect(function()
    St.raceTrack = 2
    rb2.BackgroundColor3 = C.Green
    rb1.BackgroundColor3 = C.Off
    if St.autoRace then stopRace() task.wait(0.3) startRace() end
end)

local spSub = Instance.new("Frame")
spSub.Size = UDim2.new(1, 0, 0, 50)
spSub.BackgroundColor3 = C.Sub
spSub.BackgroundTransparency = 0.25
spSub.BorderSizePixel = 0
spSub.LayoutOrder = nlo()
spSub.Parent = scr
Instance.new("UICorner", spSub).CornerRadius = UDim.new(0, 7)

local spTitle = Instance.new("TextLabel", spSub)
spTitle.Size = UDim2.new(1, -8, 0, 18)
spTitle.Position = UDim2.new(0, 6, 0, 2)
spTitle.Text = "Race Speed (1-25)"
spTitle.TextColor3 = C.Txt
spTitle.Font = Enum.Font.GothamSemibold
spTitle.TextSize = 9
spTitle.TextXAlignment = Enum.TextXAlignment.Left
spTitle.BackgroundTransparency = 1

local spBox = Instance.new("TextBox", spSub)
spBox.Size = UDim2.new(0, 44, 0, 22)
spBox.Position = UDim2.new(0, 6, 0, 22)
spBox.Text = tostring(St.raceSpeed)
spBox.BackgroundColor3 = Color3.fromRGB(14, 14, 22)
spBox.BackgroundTransparency = 0.1
spBox.TextColor3 = C.Txt
spBox.Font = Enum.Font.Gotham
spBox.TextSize = 10
spBox.ClearTextOnFocus = false
Instance.new("UICorner", spBox).CornerRadius = UDim.new(0, 5)

local function mkSpB(xo, txt)
    local b = Instance.new("TextButton", spSub)
    b.Size = UDim2.new(0, 24, 0, 22)
    b.Position = UDim2.new(0, xo, 0, 22)
    b.Text = txt
    b.TextColor3 = C.Txt
    b.BackgroundColor3 = C.Acc
    b.BackgroundTransparency = 0.2
    b.Font = Enum.Font.GothamBold
    b.TextSize = 13
    b.BorderSizePixel = 0
    Instance.new("UICorner", b).CornerRadius = UDim.new(0, 5)
    return b
end
local spM = mkSpB(54, "-")
local spP = mkSpB(82, "+")

spBox.FocusLost:Connect(function(e)
    if e then
        local n = tonumber(spBox.Text)
        St.raceSpeed = n and clamp(math.floor(n), 1, 25) or St.raceSpeed
        spBox.Text = tostring(St.raceSpeed)
    end
end)
spM.MouseButton1Click:Connect(function()
    St.raceSpeed = clamp(St.raceSpeed - 1, 1, 25)
    spBox.Text = tostring(St.raceSpeed)
end)
spP.MouseButton1Click:Connect(function()
    St.raceSpeed = clamp(St.raceSpeed + 1, 1, 25)
    spBox.Text = tostring(St.raceSpeed)
end)

div("COOKING")
mkToggle("Auto Cook 🍔", "autoCook", function() startCook() end, function() stopCook() end)

-- Scroll fix
task.spawn(function()
    while SCRIPT_ACTIVE do
        scr.CanvasSize = UDim2.new(0, 0, 0, lay.AbsoluteContentSize.Y + 10)
        task.wait(0.5)
    end
end)

print("✅ SpongeMobile v9.2 RACE FLASH & BOAT FIX caricato")
print("   Zone: " .. #zoneNames .. " | Eggs: " .. #eggs)

Features & Information

new uptade
#spongebob simulator

Community Comments (4)

DeMenTorDeMenTorFeb 25, 2026

Op Script

SpongeCarlSpongeCarlFeb 25, 2026

@yogurt888888 Hi! Your script is super OP, but I found a few things that need fixing. The 8x and 3x eggs aren't working in some areas; from what I've seen, they only work up to Area 65 (Basic). Also, both boat auto races are way too slow—I can't even get a bronze medal sometimes because i go to void. Lastly, the auto pedestal is broken; it doesn't TP anymore. I'd be very grateful if you could fix these. Thanks!

Replying to @SpongeCarl
yogurt888888yogurt888888Feb 26, 2026

@SpongeCarl i see what I can do in the meantime I'll leave the old version

Replying to @yogurt888888
SpongeCarlSpongeCarlFeb 27, 2026

@yogurt888888 thank you

More Scripts for SpongeBob Simulator