if getgenv and getgenv().__BALDIMOD then getgenv().__BALDIMOD.destroy()end local ok,Nebula=pcall(function()return loadstring(game:HttpGet("https://github.com/lzhenweiDev/Nebula-UI/raw/refs/heads/main/V3.lua"))()end)if not ok or not Nebula then warn("[BaldiMod] Nebula load fail: "..tostring(Nebula));return end local Players=game:GetService("Players")local RunService=game:GetService("RunService")local UIS=game:GetService("UserInputService")local Workspace=game:GetService("Workspace")local Lighting=game:GetService("Lighting")local LP=Players.LocalPlayer local GAME=Workspace:WaitForChild("Game")local MAP=Workspace:WaitForChild("Map")local CHARS=Workspace:FindFirstChild("Characters")local GI=LP:WaitForChild("PlayerGui"):WaitForChild("GameInterface")local S={walkOn=false,walkVal=10,jumpOn=false,jumpVal=50,infJump=false,noclip=false,fly=false,flySpeed=60,god=false,infStam=false,noVoid=false,baldiIgnore=false,baldiNonLethal=false,baldiFreeze=false,prinDisable=false,npcFreeze={},espNotebook=false,espItem=false,espNPC=false,espExit=false,espPlayers=false,fullbright=false,fov=70,noFog=false,antiAfk=false,autoSolve=false}local ESP_FOLDER=Instance.new("Folder");ESP_FOLDER.Name="__BaldiESP";ESP_FOLDER.Parent=Workspace local espCache={};local anchorState={};local Window local function getChar()local c=LP.Character if c and c:FindFirstChild("HumanoidRootPart")then return c end local pcf=Workspace:FindFirstChild("PlayerCharactersFolder")if pcf then for _,m in ipairs(pcf:GetChildren())do if m:IsA("Model")and m.Name==LP.Name then return m end end end return c end local function getHum()local c=getChar();return c and c:FindFirstChildOfClass("Humanoid")end local function getHRP()local c=getChar();return c and c:FindFirstChild("HumanoidRootPart")end local function tp(cf)local h=getHRP();if h then h.CFrame=cf end end local function safe(fn)local o,e=pcall(fn);if not o then warn("[BaldiMod] "..tostring(e))end end local function notify(t,c,ty)pcall(function()Window:Notify({Title=t or "BaldiMod",Content=c or "",Type=ty or "info",Duration=4})end)end local function getFolderVal(f,n)local x=GAME:FindFirstChild(f);return x and x:FindFirstChild(n)end local NPC_MAP={GottaSweep="Gotta Sweep",FirstPrize="1st Prize",Bully="Bully",Playtime="Playtime",Crafters="Crafters",Friend="Friend",Tutor="Tutor",Principal="Principal",Baldi="Baldi"}local function entityModel(key)CHARS=Workspace:FindFirstChild("Characters");if not CHARS then return end local real=NPC_MAP[key]or key;return CHARS:FindFirstChild(real)or CHARS:FindFirstChild(key)end local function makeHL(inst,color)if not inst or not inst.Parent or espCache[inst]then return end local hl=Instance.new("Highlight");hl.FillColor=color;hl.OutlineColor=Color3.new(1,1,1)hl.FillTransparency=0.45;hl.OutlineTransparency=0;hl.DepthMode=Enum.HighlightDepthMode.AlwaysOnTop hl.Adornee=inst;hl.Parent=ESP_FOLDER;espCache[inst]=hl end local function clearESP(pred)for inst,hl in pairs(espCache)do if pred==nil or pred(inst)then hl:Destroy();espCache[inst]=nil end end end local COLS={Cyan=true,Red=true,Blue=true,Salmon=true,Green=true,Black=true,Yellow=true}local function notebookParts()local o={};local f=MAP:FindFirstChild("Notebooks");if not f then return o end local books=f:FindFirstChild("Books")if books then for _,b in ipairs(books:GetChildren())do if b:IsA("BasePart")then table.insert(o,b)end end end if#o==0 then for _,d in ipairs(f:GetDescendants())do if d:IsA("BasePart")and COLS[d.Name]then table.insert(o,d)end end end return o end local function solverRefs()local ev=GI:FindFirstChild("Events");ev=ev and ev:FindFirstChild("YCTP")local yctp=GI:FindFirstChild("YCTP");local cfg=yctp and yctp:FindFirstChild("Configuration")local nbk=GAME:FindFirstChild("Notebook")return ev,cfg,nbk end local function currentAnswer(cfg,nbk)local u2=tostring((nbk.Collected.Value)+(nbk.SolversAmount.Value))local set=nbk.Questions:FindFirstChild(u2);if not set then return nil end local p=set:FindFirstChild("P"..tostring(cfg.Problem.Value))local a=p and p:FindFirstChild("Ans");return a and a.Value end local solving=false local function solveOnce()local ev,cfg,nbk=solverRefs()if not(ev and cfg and nbk)or solving or not cfg:FindFirstChild("Enabled")or cfg.Enabled.Value~=true then return end solving=true safe(function()local ex=GAME:FindFirstChild("Extra");if ex and ex:FindFirstChild("Ans42true")then ex.Ans42true.Value=true end local guard=0 while cfg.Enabled.Value and cfg.Problem.Value>=1 and cfg.Problem.Value<=3 and guard<20 do guard=guard+1 local ans=currentAnswer(cfg,nbk);if ans==nil then break end if ans=="nan"then ans="42"end local before=cfg.Problem.Value ev:Fire(ans)local t=0;repeat task.wait(0.08);t=t+1 until cfg.Problem.Value~=before or cfg.Enabled.Value~=true or t>30 end end)solving=false end task.spawn(function()local _,cfg=solverRefs()if cfg and cfg:FindFirstChild("Enabled")then cfg.Enabled:GetPropertyChangedSignal("Value"):Connect(function()if S.autoSolve and cfg.Enabled.Value==true then task.wait(0.25);solveOnce()end end)end end)local function triggerNotebook(part)local hrp=getHRP();if not(hrp and part)then return end pcall(function()if firetouchinterest then firetouchinterest(hrp,part,0);task.wait(0.05);firetouchinterest(hrp,part,1)end end)for _=1,6 do tp(part.CFrame*CFrame.new(0,2,0));task.wait(0.12)end end local wsConns={}local function hookWS()for _,c in ipairs(wsConns)do pcall(function()c:Disconnect()end)end;wsConns={}local hum=getHum();if not hum then return end local busy=false local function apply()if S.walkOn and not busy then busy=true;if hum.WalkSpeed~=S.walkVal then hum.WalkSpeed=S.walkVal end;busy=false end end table.insert(wsConns,hum:GetPropertyChangedSignal("WalkSpeed"):Connect(apply));apply()end hookWS()LP.CharacterAdded:Connect(function()task.wait(0.3);hookWS()end)local pcf=Workspace:FindFirstChild("PlayerCharactersFolder")if pcf then pcf.ChildAdded:Connect(function()task.wait(0.3);hookWS()end)end local function setFrozen(model,frozen)if not model then return end for _,p in ipairs(model:GetDescendants())do if p:IsA("BasePart")then if frozen then if anchorState[p]==nil then anchorState[p]=p.Anchored end;p.Anchored=true else if anchorState[p]~=nil then p.Anchored=anchorState[p];anchorState[p]=nil end end end end end local flyKeys={W=false,A=false,S=false,D=false,Space=false,Shift=false}UIS.InputBegan:Connect(function(i,gpe)if gpe then return end local k=i.KeyCode if k==Enum.KeyCode.W then flyKeys.W=true elseif k==Enum.KeyCode.A then flyKeys.A=true elseif k==Enum.KeyCode.S then flyKeys.S=true elseif k==Enum.KeyCode.D then flyKeys.D=true elseif k==Enum.KeyCode.Space then flyKeys.Space=true elseif k==Enum.KeyCode.LeftShift then flyKeys.Shift=true end if S.infJump and k==Enum.KeyCode.Space then local h=getHum();if h then h:ChangeState(Enum.HumanoidStateType.Jumping)end end end)UIS.InputEnded:Connect(function(i)local k=i.KeyCode if k==Enum.KeyCode.W then flyKeys.W=false elseif k==Enum.KeyCode.A then flyKeys.A=false elseif k==Enum.KeyCode.S then flyKeys.S=false elseif k==Enum.KeyCode.D then flyKeys.D=false elseif k==Enum.KeyCode.Space then flyKeys.Space=false elseif k==Enum.KeyCode.LeftShift then flyKeys.Shift=false end end)local VirtualUser=game:GetService("VirtualUser")local lastAfk=tick();local espTick=0 local hbConn=RunService.Heartbeat:Connect(function(dt)safe(function()local hum=getHum();local hrp=getHRP()if S.walkOn and hum and hum.WalkSpeed~=S.walkVal then hum.WalkSpeed=S.walkVal end if S.jumpOn and hum then hum.UseJumpPower=true;hum.JumpPower=S.jumpVal;hum.JumpHeight=S.jumpVal/8 end if S.god and hum then hum.MaxHealth=math.huge;hum.Health=math.huge end if S.infStam then local sc=GI:FindFirstChild("StamConfiguration")if sc then if sc:FindFirstChild("MaxStamina")then sc.MaxStamina.Value=math.max(sc.MaxStamina.Value,500)end if sc:FindFirstChild("Stamina")then sc.Stamina.Value=(sc:FindFirstChild("MaxStamina")and sc.MaxStamina.Value)or 500 end end local sm=getFolderVal("ItemSettings","StaminaMultiplier");if sm then sm.Value=0 end end if S.noclip then local c=getChar();if c then for _,p in ipairs(c:GetDescendants())do if p:IsA("BasePart")then p.CanCollide=false end end end end if S.noVoid and hrp and hrp.Position.Y<-50 then tp(CFrame.new(0,10,0))end if S.fly and hrp then local cam=Workspace.CurrentCamera;local mv=Vector3.new()if flyKeys.W then mv=mv+cam.CFrame.LookVector end if flyKeys.S then mv=mv-cam.CFrame.LookVector end if flyKeys.A then mv=mv-cam.CFrame.RightVector end if flyKeys.D then mv=mv+cam.CFrame.RightVector end if flyKeys.Space then mv=mv+Vector3.new(0,1,0)end if flyKeys.Shift then mv=mv-Vector3.new(0,1,0)end if hum then hum.PlatformStand=true end;hrp.Velocity=Vector3.new()if mv.Magnitude>0 then hrp.CFrame=hrp.CFrame+mv.Unit*S.flySpeed*dt end elseif hum and hum.PlatformStand and not S.fly then hum.PlatformStand=false end local b=GAME:FindFirstChild("Baldi")if b then if S.baldiIgnore and b:FindFirstChild("Ignorance")then b.Ignorance.Value=true end if S.baldiNonLethal and b:FindFirstChild("Lethal")then b.Lethal.Value=false end if S.baldiFreeze then if b:FindFirstChild("SpeedMultiplier")then b.SpeedMultiplier.Value=0 end if b:FindFirstChild("AngerPoint")then b.AngerPoint.Value=0 end end end if S.baldiFreeze then setFrozen(entityModel("Baldi"),true)end if S.prinDisable then local p=GAME:FindFirstChild("Principal")if p then if p:FindFirstChild("Ignorance")then p.Ignorance.Value=true end if p:FindFirstChild("SpeedMultiplier")then p.SpeedMultiplier.Value=0 end end setFrozen(entityModel("Principal"),true)end for name,on in pairs(S.npcFreeze)do if on then setFrozen(entityModel(name),true)local f=GAME:FindFirstChild(name);if f and f:FindFirstChild("SpeedMultiplier")then f.SpeedMultiplier.Value=0 end end end if S.fullbright then Lighting.Brightness=2;Lighting.ClockTime=14;Lighting.FogEnd=1e9;Lighting.GlobalShadows=false Lighting.Ambient=Color3.fromRGB(178,178,178);Lighting.OutdoorAmbient=Color3.fromRGB(178,178,178)end if S.noFog then Lighting.FogEnd=1e9;Lighting.FogStart=1e9 for _,a in ipairs(Lighting:GetChildren())do if a:IsA("Atmosphere")then a.Density=0 end end end if Workspace.CurrentCamera then Workspace.CurrentCamera.FieldOfView=S.fov end if S.antiAfk and tick()-lastAfk>60 then lastAfk=tick()pcall(function()VirtualUser:CaptureController();VirtualUser:ClickButton2(Vector2.new())end)end end)espTick=espTick+dt if espTick>0.4 then espTick=0 safe(function()if S.espNotebook then for _,p in ipairs(notebookParts())do local fin=p:FindFirstChild("Finished")if not(fin and fin.Value)then makeHL(p,Color3.fromRGB(0,255,120))end end else clearESP(function(i)local f=MAP:FindFirstChild("Notebooks");return f and i:IsDescendantOf(f)end)end if S.espItem then local it=MAP:FindFirstChild("Items")if it then for _,m in ipairs(it:GetDescendants())do if m:IsA("Model")and m:FindFirstChildWhichIsA("BasePart")then makeHL(m,Color3.fromRGB(255,200,0))end end end else clearESP(function(i)local it=MAP:FindFirstChild("Items");return it and i:IsDescendantOf(it)end)end if S.espExit then local ex=MAP:FindFirstChild("Exits")if ex then for _,m in ipairs(ex:GetChildren())do if m:IsA("Model")then makeHL(m,Color3.fromRGB(0,180,255))end end end else clearESP(function(i)local ex=MAP:FindFirstChild("Exits");return ex and i:IsDescendantOf(ex)end)end if S.espNPC then CHARS=Workspace:FindFirstChild("Characters")if CHARS then for _,m in ipairs(CHARS:GetChildren())do if m:IsA("Model")then makeHL(m,Color3.fromRGB(255,40,40))end end end else clearESP(function(i)local c=Workspace:FindFirstChild("Characters");return c and i:IsDescendantOf(c)end)end if S.espPlayers then local p2=Workspace:FindFirstChild("PlayerCharactersFolder")if p2 then for _,m in ipairs(p2:GetChildren())do if m:IsA("Model")and m.Name~=LP.Name then makeHL(m,Color3.fromRGB(160,80,255))end end end end end)end end)Window=Nebula.CreateWindow({Title="BALDI MENU ⚡ ULTIMATE v3.1",ConfigName="BaldiUltimate",ShowLoading=true,LoadingDuration=1.5,LoadingSteps={"Loading v3.1...","Notebook auto-solver...","Ready!"}})local pTab=Window:CreateTab("Player","🏃")local pMove=Nebula.CreateSection(pTab,{Name="Movement"})pMove:CreateToggle({Name="WalkSpeed Override",Default=false,Callback=function(v)S.walkOn=v;hookWS()end})pMove:CreateSlider({Name="WalkSpeed",Min=10,Max=250,Default=10,Suffix=" spd",Callback=function(v)S.walkVal=v;hookWS()end})pMove:CreateToggle({Name="JumpPower Override",Default=false,Callback=function(v)S.jumpOn=v end})pMove:CreateSlider({Name="JumpPower",Min=10,Max=300,Default=50,Suffix=" jp",Callback=function(v)S.jumpVal=v end})pMove:CreateToggle({Name="Infinite Jump",Default=false,Callback=function(v)S.infJump=v end})pMove:CreateToggle({Name="Noclip (thru walls)",Default=false,Callback=function(v)S.noclip=v end})pMove:CreateToggle({Name="Fly (WASD+Space/Shift)",Default=false,Callback=function(v)S.fly=v end})pMove:CreateSlider({Name="Fly Speed",Min=20,Max=300,Default=60,Suffix=" spd",Callback=function(v)S.flySpeed=v end})local pSurv=Nebula.CreateSection(pTab,{Name="Survival"})pSurv:CreateToggle({Name="God Mode",Default=false,Callback=function(v)S.god=v end})pSurv:CreateToggle({Name="Infinite Stamina",Default=false,Callback=function(v)S.infStam=v end})pSurv:CreateToggle({Name="Anti-Void",Default=false,Callback=function(v)S.noVoid=v end})pSurv:CreateButton({Name="Heal / Reset Health",Callback=function()local h=getHum();if h then h.Health=h.MaxHealth end end})pSurv:CreateButton({Name="Respawn Character",Callback=function()local h=getHum();if h then h.Health=0 end end})local bTab=Window:CreateTab("Baldi","📕")local bSec=Nebula.CreateSection(bTab,{Name="Baldi (freeze=local anchor)"})bSec:CreateToggle({Name="Baldi Can't See You",Default=false,Callback=function(v)S.baldiIgnore=v end})bSec:CreateToggle({Name="Baldi Non-Lethal",Default=false,Callback=function(v)S.baldiNonLethal=v end})bSec:CreateToggle({Name="Freeze Baldi (anchor)",Default=false,Callback=function(v)S.baldiFreeze=v;if not v then setFrozen(entityModel("Baldi"),false)end end})bSec:CreateSlider({Name="Baldi Speed",Min=0,Max=150,Default=73,Suffix=" spd",Callback=function(v)local x=getFolderVal("Baldi","NormalSpeed");if x then x.Value=v end end})bSec:CreateButton({Name="Reset Baldi Anger",Callback=function()local a=getFolderVal("Baldi","AngerPoint");if a then a.Value=0 end;notify("Baldi","Anger reset","success")end})bSec:CreateButton({Name="Teleport Baldi Away",Callback=function()local m=entityModel("Baldi");local hrp=m and m:FindFirstChild("HumanoidRootPart");if hrp then hrp.CFrame=CFrame.new(9999,9999,9999)end end})local nTab=Window:CreateTab("NPCs","👥")local nSec=Nebula.CreateSection(nTab,{Name="Principal"})nSec:CreateToggle({Name="Disable Principal (anchor)",Default=false,Callback=function(v)S.prinDisable=v;if not v then setFrozen(entityModel("Principal"),false)end end})nSec:CreateButton({Name="Turn off ALL rules",Callback=function()local p=GAME:FindFirstChild("Principal")if p then for _,r in ipairs({"NoDrinking","NoEntering","NoEscaping","NoRunning","NoBullyingInTheHalls"})do local x=p:FindFirstChild(r);if x then x.Value=false end end end;notify("Principal","Rules off","success")end})local npcList={"GottaSweep","FirstPrize","Bully","Playtime","Crafters","Friend","Tutor"}local nFreeze=Nebula.CreateSection(nTab,{Name="Freeze NPCs (anchor)"})for _,nm in ipairs(npcList)do nFreeze:CreateToggle({Name="Freeze "..nm,Default=false,Callback=function(v)S.npcFreeze[nm]=v;if not v then setFrozen(entityModel(nm),false)end end})end nFreeze:CreateButton({Name="Freeze EVERYONE",Callback=function()for _,nm in ipairs(npcList)do S.npcFreeze[nm]=true end;S.prinDisable=true;S.baldiFreeze=true;notify("NPCs","Frozen","success")end})nFreeze:CreateButton({Name="Unfreeze EVERYONE",Callback=function()for _,nm in ipairs(npcList)do S.npcFreeze[nm]=false;setFrozen(entityModel(nm),false)end;S.prinDisable=false;S.baldiFreeze=false;setFrozen(entityModel("Principal"),false);setFrozen(entityModel("Baldi"),false);notify("NPCs","Unfrozen","info")end})local nbTab=Window:CreateTab("Notebooks","📗")local nbSec=Nebula.CreateSection(nbTab,{Name="Auto-Solver"})nbSec:CreateToggle({Name="Auto-Solve (instant answers)",Default=false,Callback=function(v)S.autoSolve=v;if v then solveOnce()end;notify("Notebook",v and "ON — walk into any notebook"or "OFF",v and "success"or "info")end})nbSec:CreateButton({Name="Solve Current Notebook Now",Callback=function()solveOnce();notify("Notebook","Solving current...","success")end})local nbSec2=Nebula.CreateSection(nbTab,{Name="Collect"})nbSec2:CreateToggle({Name="Notebook ESP",Default=false,Callback=function(v)S.espNotebook=v end})nbSec2:CreateButton({Name="TP to Nearest Notebook",Callback=function()local hrp=getHRP();if not hrp then return end;local best,bd for _,p in ipairs(notebookParts())do local fin=p:FindFirstChild("Finished")if not(fin and fin.Value)then local d=(p.Position-hrp.Position).Magnitude;if not bd or d25 if cfg and cfg.Enabled.Value==true then solveOnce()end local t2=0;repeat task.wait(0.1);t2=t2+1 until(cfg and cfg.Enabled.Value~=true)or t2>80 task.wait(0.4)end end notify("Notebook","Auto-collect finished ⚡","success")end)end})local tTab=Window:CreateTab("Teleports","🚪")local tSec=Nebula.CreateSection(tTab,{Name="Locations"})tSec:CreateToggle({Name="Exit ESP",Default=false,Callback=function(v)S.espExit=v end})tSec:CreateButton({Name="TP to Exit #1",Callback=function()local ex=MAP:FindFirstChild("Exits");local m=ex and ex:GetChildren()[1];local part=m and m:FindFirstChildWhichIsA("BasePart",true);if part then tp(part.CFrame*CFrame.new(0,4,0))end end})tSec:CreateButton({Name="TP to Spawn",Callback=function()local sp=Workspace:FindFirstChild("SpawnLocation");if sp then tp(sp.CFrame*CFrame.new(0,4,0))end end})local savedCF tSec:CreateButton({Name="Save Position",Callback=function()local h=getHRP();if h then savedCF=h.CFrame;notify("TP","Saved","success")end end})tSec:CreateButton({Name="Load Saved Position",Callback=function()if savedCF then tp(savedCF)end end})local iTab=Window:CreateTab("Items","🎒")local iSec=Nebula.CreateSection(iTab,{Name="Items"})iSec:CreateToggle({Name="Item ESP",Default=false,Callback=function(v)S.espItem=v end})iSec:CreateButton({Name="Grab ALL items to me",Callback=function()local hrp=getHRP();local it=MAP:FindFirstChild("Items");if not(hrp and it)then return end;local i=0 for _,m in ipairs(it:GetDescendants())do if m:IsA("BasePart")then i=i+1;m.CFrame=hrp.CFrame*CFrame.new(math.random(-4,4),2,math.random(-4,4))end end;notify("Items","Pulled "..i,"success")end})local vTab=Window:CreateTab("Visuals","🎨")local vSec=Nebula.CreateSection(vTab,{Name="Visual / ESP"})vSec:CreateToggle({Name="NPC ESP (characters)",Default=false,Callback=function(v)S.espNPC=v end})vSec:CreateToggle({Name="Player ESP (multiplayer)",Default=false,Callback=function(v)S.espPlayers=v end})vSec:CreateToggle({Name="Full Bright",Default=false,Callback=function(v)S.fullbright=v end})vSec:CreateToggle({Name="No Fog",Default=false,Callback=function(v)S.noFog=v end})vSec:CreateSlider({Name="Field of View",Min=40,Max=120,Default=70,Suffix="°",Callback=function(v)S.fov=v end})vSec:CreateButton({Name="Clear ALL ESP",Callback=function()S.espNotebook=false;S.espItem=false;S.espNPC=false;S.espExit=false;S.espPlayers=false;clearESP(nil);notify("ESP","Cleared","info")end})local mTab=Window:CreateTab("Misc","⚙️")local mSec=Nebula.CreateSection(mTab,{Name="Utility"})mSec:CreateToggle({Name="Anti-AFK",Default=false,Callback=function(v)S.antiAfk=v end})mSec:CreateButton({Name="Copy Job ID",Callback=function()pcall(function()setclipboard(game.JobId)end);notify("Misc","JobId copied","success")end})mSec:CreateButton({Name="Rejoin Server",Callback=function()pcall(function()game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId,game.JobId,LP)end)end})mSec:CreateButton({Name="Server Hop",Callback=function()pcall(function()game:GetService("TeleportService"):Teleport(game.PlaceId,LP)end)end})local aSec=Nebula.CreateSection(mTab,{Name="Menu"})aSec:CreateButton({Name="Unload / Destroy Menu",Callback=function()getgenv().__BALDIMOD.destroy()end})if not getgenv then getgenv=function()return _G end end getgenv().__BALDIMOD={destroy=function()pcall(function()hbConn:Disconnect()end)for _,c in ipairs(wsConns)do pcall(function()c:Disconnect()end)end for p,st in pairs(anchorState)do pcall(function()p.Anchored=st end)end pcall(function()ESP_FOLDER:Destroy()end)pcall(function()Window:Destroy()end)getgenv().__BALDIMOD=nil end}notify("BALDI v3.1","Loaded 🧮⚡","success")print("[BaldiMod] v3.1 loaded .")