local SCRIPT_ID = "Bake the Baby Admin Panel | PlayerTools v4.12" local SUPPORTED_PLACE_ID = 14567590300 if game.PlaceId ~= SUPPORTED_PLACE_ID then return end local function createHandoffStore(storage) local a=game:GetService('HttpService')local b=game:GetService('Players').LocalPlayer local c={path='BakeTheBabyState.json',status='Not checked'}local function d(e)local f=storage[e]or getfenv()[e]return type(f)=='function'and f or nil end function c.available()return d('readfile')~=nil and d('writefile')~=nil end function c.read()local e=d('readfile')if not e then return nil,'readfile unavailable'end local f,g=pcall(e,c.path)if not f or type(g)~='string'then return nil, 'JSON missing or unreadable'end if#g>65536 then return nil,'JSON too large'end local h,i=pcall(function()return a:JSONDecode(g)end)if not h or type(i)~='table'then return nil,'Invalid JSON'end return i end function c.owned(e)return type(e)=='table'and e.schema==1 and e.placeId==SUPPORTED_PLACE_ID and b and e.userId==b.UserId end function c.pending(e)return c.owned(e)and e.status=='hopping_servers'and type(e.attemptId)=='string'and#e.attemptId>0 and type(e.sourceJob)=='string'and e.sourceJob~= game.JobId and e.destinationJob==game.JobId and type(e.updatedAt)=='number'and os.time()>=e.updatedAt and os.time()-e.updatedAt<=600 and type(e.resume)=='table'and e.resume.version=='4.12'and e.resume.enabled==true and e.resume.AutoRun==true and e.resume.placeId==SUPPORTED_PLACE_ID and e.resume.sourceJob==e.sourceJob end function c.write(e)local f,g=d('writefile'),d('readfile')if not f or not g then c.status='JSON unavailable: readfile + writefile required'return false end local h,i=pcall( function()local h=c.read()local i={}if c.owned(h)and type(h.history)=='table'then for j=math.max(1,#h.history-10),math.min(#h.history,100)do local k=h.history[j]if type(k)=='table'and type(k.at)=='number'and type(k.status)=='string'then table.insert(i,{at=k.at,status=k.status:sub(1,32),reason=type(k.reason)=='string'and k.reason:sub(1,120)or''})end end end table.insert(i,{at=os.time(),status=e.status,reason=e.reason})e.history=i local j=a:JSONEncode(e)assert(#j<=65536,'JSON too large')assert(f(c .path,j)~=false,'writefile rejected the update')assert(g(c.path)==j,'JSON write verification failed')end)c.status=h and e.status or('JSON write failed: '..tostring(i):sub(1,120))return h end function c.normal(e,f)return c.write({schema=1,placeId=SUPPORTED_PLACE_ID,userId=b.UserId,status='normal',updatedAt=os.time(),reason=e,attemptId=f and f.attemptId,sourceJob=f and f.sourceJob,destinationJob=f and f.destinationJob})end function c.mark(e,f)local g,h=pcall(function()return a:GenerateGUID(false) end)if not g then c.status='Could not identify JSON handoff'return false end local i={schema=1,placeId=SUPPORTED_PLACE_ID,userId=b.UserId,status='hopping_servers',updatedAt=os.time(),reason='hop_requested',sourceJob=game.JobId,destinationJob=f,attemptId=h,resume=e}return c.write(i)end function c.cancel(e)local f=c.read()if c.owned(f)and f.status=='hopping_servers'and f.sourceJob==game.JobId then return c.normal(e,f)end return true end function c.consume(e)local f=c.read()if not c.pending(f)or f. attemptId~=e.attemptId then c.status='JSON resume already cleared or replaced'return false end return c.normal('automation_resumed',f)end return c end local function createPanel(Rayfield, storage) local a=game:GetService('Players')local b=game:GetService('RunService')local c=game:GetService('UserInputService')local d=game:GetService('ProximityPromptService')local e=game:GetService('CollectionService')local f=game:GetService('Workspace')local g=game:GetService('ReplicatedStorage')local h=game:GetService('Lighting')local i=game:GetService('TeleportService')local j=game:GetService('HttpService')local k=a.LocalPlayer assert(k,'Bake the Baby Admin Panel must run on the client.')local l=k: WaitForChild('PlayerGui')local m={AutoGrab=false,ExpandPickup=false,PickupRadius=18,ShowPickupRange=false,AutoOven=false,TravelToOven=true,ReturnAfterOven=true,OvenESP=false,AutoRescue=false,RescueRadius=12,BakerAlert=false,AlertRadius=35,InstantPrompts=true,AutoPrompts=false,OnlyEPrompts=false,RepeatPrompts=false,ESP=true,ESPDistance=3000,ESPColor=Color3.fromRGB(255,85,100),Speed=false,WalkSpeed=32,Jump=false,JumpPower=70,InfiniteJump=false,Noclip=false,Fly=false,FlySpeed=60,Fullbright=false, CustomFOV=false,FOV=90,PauseUnfocused=true,UseSavedSpot=false,AutoRun=false,AutoHop=true,QueueMode='Any populated',JoinEmpty=false,HideDistance=500,RunInBackground=true,AntiAFK=true,LowGraphics=false,Disable3DRendering=false}local n,o=true,true local p,q,r={},{},{}local s,t,u,v,w={},{},{},{},{}local x:{[string]:any}={}local y={movement={},collision={},prompt={},lighting={},camera={},graphics={}}local z={betweenBabies=0.5,catchAttempt=0.1,catchTeleport=0.02}local A:{[string]:any}={active=false, idleStatus='Waiting for idle event',renderDisabled=false,renderStatus='3D rendering unchanged'}local B,C,D,E local F,G,H,I local J,K,L,M,N,O local P,Q,R='Automatic','','All server players'local S,T local U,V,W,X local Y,Z={},false local _,aa,ab='','Ready',0 local ac,ad,ae=-math.huge,-math.huge,nil local af,ag=0,0 local ah,ai='',''local aj={grabs=0,deposits=0,rescues=0,prompts=0,failedInputs=0}local ak=os.clock local al=Rayfield.Destroy local am={PlayerOptions={},OvenOptions={}}local an:{[string] :any}={status='Stopped',queues={},queueCooldowns={},queueLabels={},ovens={},ovenCooldowns={},ovenOccupants={},ovenApproaches={},catchCooldowns={},nextScan=0,nextQueueCheck=0}local ao:{[string]:any}={status='Waiting for automation',nextCheck=0,failures=0,generation=0,visited={{id=game.JobId,at=os.time()}},started=ak(),sessionStarted=os.time(),attempts=0,armed=false}local ap=createHandoffStore(storage)local function aq(ar)local as=storage[ar]or getfenv()[ar]return type(as)=='function'and as or nil end local function ar()for as,at in ipairs({'queue_on_teleport','queueonteleport'})do local au=aq(at)if au then return au end end for as,at in ipairs({'syn','fluxus'})do local au=storage[at]or getfenv()[at]if type(au)=='table'and type(au.queue_on_teleport)=='function'then return au.queue_on_teleport end end return nil end local function as(at,au,av)local aw=Instance.new(at)for ax,ay in pairs(au or{})do aw[ax]=ay end aw.Parent=av return aw end local at=as('ScreenGui',{Name= 'BakeTheBabyAdminRuntime',ResetOnSpawn=false},l)local au=as('BindableFunction',{Name='Shutdown'},at)local av=as('Folder',{Name='BakeTheBaby_LocalEffects'},f)local function aw(ax,ay,az)local aA=ax:Connect(ay)table.insert(az or p,aA)return aA end local function ax(ay)for az,aA in ipairs(ay)do aA:Disconnect()end table.clear(ay)end local function ay(az,aA,aB,aC)local aD=aA[aB]local aE=az[aA]if not aE then aE={}az[aA]=aE end local aF=aE[aB]if not aF then aF={original=aD,applied=aD}aE[aB]=aF elseif aD ~=aF.applied then aF.original=aD end aF.applied=aC if aD~=aC then aA[aB]=aC end end local function az(aA,aB,aC)local aD=aA[aB]local aE=aD and aD[aC]if not aE then return end aD[aC]=nil pcall(function()if aB[aC]==aE.applied then aB[aC]=aE.original end end)if next(aD)==nil then aA[aB]=nil end end local function aA(aB,aC)local aD=aB[aC]if not aD then return end local aE={}for aF in pairs(aD)do table.insert(aE,aF)end for aF,aG in ipairs(aE)do az(aB,aC,aG)end end local function aB(aC)local aD={}for aE in pairs(aC)do table.insert(aD,aE)end for aE,aF in ipairs(aD)do aA(aC,aF)end end local function aC()return m.AutoRun or m.AutoGrab or m.AutoOven or m.AutoRescue or m.AutoPrompts or B~=nil or X~=nil end local function aD()return m.RunInBackground and aC()end local function aE(aF)if not n or not m.LowGraphics or not aF.Parent then return end if aF:IsA('ParticleEmitter')or aF:IsA('Trail')or aF:IsA('Beam')or aF:IsA('Smoke')or aF:IsA('Fire')or aF:IsA('Sparkles')or aF:IsA('PostEffect')then pcall(ay ,y.graphics,aF,'Enabled',false)end end local function aF()if A.active==m.LowGraphics then return end A.active=m.LowGraphics if not m.LowGraphics then aB(y.graphics)return end ay(y.graphics,h,'GlobalShadows',false)for aG,aH in ipairs({f,h})do for aI,aJ in ipairs(aH:GetDescendants())do aE(aJ)end end end local function aG(aH)if aH==A.renderDisabled then return true end local aI,aJ=pcall(function()return b:Set3dRenderingEnabled(not aH)end)if not aI or aJ==false then A.renderStatus=aH and '3D rendering control unavailable in this runtime'or'Could not restore 3D rendering; retry the toggle or H'return false end A.renderDisabled=aH A.renderStatus=aH and'3D rendering off'or'3D rendering on'return true end for aH,aI in ipairs({f,h})do aw(aI.DescendantAdded,aE)aw(aI.DescendantRemoving,function(aJ)aA(y.graphics,aJ)end)end local function aH(aI,aJ)aa,ab=aI,ak()+(aJ or 0)end local function aI(aJ)aH(aJ,4)pcall(function()Rayfield:Notify({Title='Bake the Baby Admin Panel',Content=aJ,Duration =4})end)end local function aJ(aK,...)local aL=aK for aM,aN in ipairs({...})do aL=aL and aL:FindFirstChild(aN)end return aL end local function aK(aL)local aM=aL and aL.Character if not aM or not aM:IsDescendantOf(f)then return nil end local aN=aM:FindFirstChildOfClass('Humanoid')local aO=aM:FindFirstChild('HumanoidRootPart')if aN and aN.Health>0 and aO and aO:IsA('BasePart')then return aM,aN,aO end return nil end local function aL(aM,aN)if not aM or not aN then return nil end local aO=aN: FindFirstChild(aM.Name)if aO then return aO end for aP,aQ in ipairs(aN:GetChildren())do if tostring(aQ:GetAttribute('UserId'))==tostring(aM.UserId)then return aQ end end return nil end local function aM()local aN=k:GetAttribute('CurrentGameId')if aN==false then return nil end if aN==nil then local aO=aJ(g,'Game_Status','Active_Games')for aP,aQ in ipairs(aO and aO:GetChildren()or{})do local aR=aL(k,aQ:FindFirstChild('Players'))if aQ:GetAttribute('Game_Over')~=true and aR and aR:GetAttribute( 'In_Game')==true and aR:GetAttribute('Alive')~=false then if aN~=nil then return nil end aN=aQ.Name end end end if aN==nil then return nil end local aO=tostring(aN)local aP=aJ(g,'Game_Status','Active_Games',aO)local aQ=aJ(f,'Games_Folder','Active_Games',aO)return{id=aO,config=aP,roster=aP and aP:FindFirstChild('Players'),world=aQ}end local function aN(aO,aP)if not aP then return nil end if aP.config and aP.config:GetAttribute('Game_Over')==true then return nil end local aQ=aL(aO,aP.roster)if aQ and(aQ:GetAttribute('In_Game')==false or aQ:GetAttribute('Alive')==false)then return nil end local aR=aO:GetAttribute('CurrentGameId')if aR~=nil and tostring(aR)~=aP.id then return nil end if aQ then return aQ end if aR~=nil and aO:GetAttribute('In_Game')~=false and aO:GetAttribute('Alive')~=false then return aO end return nil end local function aO(aP)local aQ=aP and aP.Character if not aQ or not aQ:IsDescendantOf(f)then return nil end if aP==k and P~='Automatic'then return P end return aQ: GetAttribute('IsBaby')and'Baby'or'Baker'end local function aP(aQ)local aR=aO(aQ)return aR=='Baker'and'Baker / Adult'or aR or'Waiting for character'end local function aQ(aR,aS)if aR==k then return'self'end local aT,aU=aN(k,aS),aN(aR,aS)if not aT or not aU then return nil end local aV,aW=aT:GetAttribute('Team'),aU:GetAttribute('Team')if aV==nil then aV=k:GetAttribute('Team')end if aW==nil then aW=aR:GetAttribute('Team')end if aV~=nil and aW~=nil then return aV==aW and'ally'or'enemy'end if k.Team and aR.Team and not k.Neutral and not aR.Neutral then return k.Team==aR.Team and'ally'or'enemy'end local aX,aY=aO(k),aO(aR)if aX and aY then return aX==aY and'ally'or'enemy'end return nil end local function aR(aS)local aT=aS and aS:GetAttribute('Carries')return aT~=nil and aT~=false and aT~=0 and aT~=''and aT~='0'end local function aS(aT)return aT:GetAttribute('IsCarried')or aT:GetAttribute('IsTrapped')end local function aT(aU,aV,aW)return aU and not aS(aU)and not aW.Anchored and not aV.Sit end local function aU(aV)local aW=aV.Parent while aW and aW~=f do if aW:IsA('Model')then local aX=a:GetPlayerFromCharacter(aW)if aX then return aX end end aW=aW.Parent end return nil end local function aV(aW)local aX=aW.Parent if not aX then return nil end if aX:IsA('Attachment')then return aX.WorldPosition,aX.Parent end if aX:IsA('BasePart')then return aX.Position,aX end if aX:IsA('Model')then return aX:GetPivot().Position,aX end return nil end local function aW(aX)return string.lower(tostring(aX or'')):gsub('[^%w]','')end local function aX(aY,aZ)for a_,a0 in ipairs(aZ)do if string.find(aY,a0,1,true)then return true end end return false end local function aY(aZ,a_)if not a_ or not a_.world or not aZ:IsDescendantOf(a_.world)then return false end local a0=aZ while a0 and a0~=a_.world do local a1=aW(a0.Name)local a2=aW(a0:GetAttribute('Name'))..aW(a0:GetAttribute('Type'))..aW(a0:GetAttribute('Title'))if a1=='traps'or aX(a1..a2,{'oven','bathtub','bathe'})then return true end for a3 in pairs( v)do if a3.Parent and a0==a3.Parent.Parent then return true end end a0=a0.Parent end return aX(aW(aZ:GetAttribute('Type')),{'oven','trap','bath'})end local function aZ(a_,a0)if not a_.Parent or not a_:IsDescendantOf(f)then return nil end local a1=aU(a_)local a2,a3=aW(a_.ActionText),aW(a_.Name)local a4,a5=aW(a_:GetAttribute('Title')),aW(a_.ObjectText)if a1 then local a6=aK(a1)if not a6 or aO(a1)~='Baby'then return nil end local a7=aQ(a1,a0)if a7=='enemy'and(a4=='catchbaby'or(a3=='mom'and a2== 'catch')or aX(a2,{'catchbaby','pickupbaby','grabbaby'}))then return'grab',a1 end if a7=='ally'and a6:GetAttribute('IsTrapped')and(a3=='baby'or a3=='all')and aX(a2,{'rescue','free','save','release'})then return'rescue',a1 end return nil end if not a0 or not a0.world or not a_:IsDescendantOf(a0.world)then return nil end if G==a_ then return'oven'end if aX(a2..a4,{'buy','purchase','donate'})then return nil end local a6=aY(a_,a0)or aX(a5..a4,{'oven','bathtub','bathe'})local a7=aX(a2..a4,{'rescue', 'free','savebaby','release','removebaby','untrap'})if a6 and(a3=='baby'or a7)then return'rescue'end if a3=='baby'or a7 then return nil end if aX(a2,{'open','close','enter','exit'})then return nil end local a8=aX(a2..a4,{'cook','bake','bathe','placebaby','putbaby','insertbaby','depositbaby'})if a8 or(a6 and(aX(a2..a4,{'place','put','insert','deposit','trap'})or(a3=='mom'and not aX(a2,{'open','close','enter','exit'}))))then return'oven'end return nil end local function a_(a0)local a1=B B=nil if a1 then if a1.thread and coroutine.status(a1.thread)~='dead'then pcall(task.cancel,a1.thread)end if a1.prompt then pcall(function()a1.prompt:InputHoldEnd()end)end if a1.delivery and a1.humanoid then az(y.movement,a1.humanoid,'AutoRotate')end if a0 and a1.returnHome then local a2,a3=pcall(a1.returnHome)if not a2 then warn('[Bake the Baby] Return failed: '..tostring(a3))end end end end local function a0()if not D then return end local a1=D D=nil a1.velocity:Destroy()a1.orientation:Destroy()a1. attachment:Destroy()az(y.movement,a1.humanoid,'PlatformStand')az(y.movement,a1.humanoid,'AutoRotate')if a1.root.Parent then a1.root.AssemblyLinearVelocity=Vector3.zero a1.root.AssemblyAngularVelocity=Vector3.zero end end local function a1(a2)if not a2 then return end if a2.highlight then a2.highlight:Destroy()end a2.billboard:Destroy()end local function a2(a3)for a4,a5 in pairs(a3)do a1(a5)a3[a4]=nil end end local function a3()if not n then return end n=false if not aG(false)then warn( [[[Bake the Baby] Rendering restore failed on unload: runtime rejected Set3dRenderingEnabled(true)]])end if ao.cancel then ao.cancel()end a_(true)if an.stopHiding then an.stopHiding(true)end if an.leaveQueue then an.leaveQueue(true)end if an.clearOvenOccupants then an.clearOvenOccupants()end ax(p)ax(q)a0()for a4,a5 in pairs(y)do aB(a5)end a2(t)a2(u)av:Destroy()at:Destroy()if storage.BakeTheBabyAdmin==am then storage.BakeTheBabyAdmin=nil end pcall(al,Rayfield)end am.Shutdown=a3 storage. BakeTheBabyAdmin=am au.OnInvoke=function()a3()return true end Rayfield.Destroy=a3 aw(at.Destroying,a3)local function a4(a5)a_()if an.stopHiding then an.stopHiding(false)end if an.leaveQueue then an.leaveQueue(false)end an.bounds,an.nextQueueCheck=nil,0 W,X=nil,nil m.UseSavedSpot=false if x.UseSavedSpot then x.UseSavedSpot:Set(false)end P='Automatic'if S then S:Set({'Automatic'})end E=nil af,ag=ak()+0.5,0 a0()aB(y.movement)aB(y.collision)ax(q)table.clear(r)if not a5 then return end aw(a5: GetAttributeChangedSignal('IsBaby'),function()a_(true)X=nil if an.stopHiding then an.stopHiding(true)end P='Automatic'if S then S:Set({'Automatic'})end aB(y.prompt)a2(t)af=ak()+0.25 end,q)for a6,a7 in ipairs(a5:GetDescendants())do if a7:IsA('BasePart')then r[a7]=true end end aw(a5.DescendantAdded,function(a6)if a6:IsA('BasePart')then r[a6]=true end end,q)aw(a5.DescendantRemoving,function(a6)aA(y.collision,a6)r[a6]=nil end,q)end aw(k.CharacterAdded,a4)aw(k.CharacterRemoving,function()a4(nil)end) a4(k.Character)aw(k:GetAttributeChangedSignal('CurrentGameId'),function()a_()if an.stopHiding then an.stopHiding(false)end if an.leaveQueue then an.leaveQueue(false)end an.bounds,an.nextQueueCheck=nil,0 if an.clearOvenOccupants then an.clearOvenOccupants()end table.clear(an.ovenCooldowns)W,X=nil,nil m.UseSavedSpot=false if x.UseSavedSpot then x.UseSavedSpot:Set(false)end E,G=nil,nil af=ak()+0.75 aB(y.prompt)a2(t)a2(u)ai,ah='',''end)aw(c.WindowFocused,function()o=true end)aw(c.WindowFocusReleased ,function()o=false if not aD()then a_(true)end end)local function a5()local a6,a7,a8=aK(k)if not a6 or aS(a6)then a0()aB(y.movement)aB(y.collision)return end if an.joining then ay(y.movement,a7,'WalkSpeed',16)elseif m.Speed then ay(y.movement,a7,'WalkSpeed',m.WalkSpeed)else az(y.movement,a7,'WalkSpeed')end if m.Jump then if a7.UseJumpPower then az(y.movement,a7,'JumpHeight')ay(y.movement,a7,'JumpPower',m.JumpPower)else az(y.movement,a7,'JumpPower')ay(y.movement,a7,'JumpHeight',m.JumpPower^2/(2* math.max(f.Gravity,1)))end else az(y.movement,a7,'JumpPower')az(y.movement,a7,'JumpHeight')end if not m.Noclip or an.joining then aB(y.collision)end local a9=B and B.delivery and B.travel if not m.Fly or an.hide or an.joining or a9 or not aT(a6,a7,a8)then a0()end if a9 then ay(y.movement,a7,'AutoRotate',false)end end local function a6()local a7,a8,a9=aK(k)if not m.Fly or an.hide or an.joining or(B and B.delivery and B.travel)or not aT(a7,a8,a9)then a0()return end if D and D.root~=a9 then a0()end if not D then local ba=as('Attachment',{Name='BTB_Flight'},a9)local bb=as('LinearVelocity',{Name='BTB_FlightVelocity',Attachment0=ba,RelativeTo=Enum.ActuatorRelativeTo.World,MaxForce=math.huge,VectorVelocity=Vector3.zero},a9)local bc=as('AlignOrientation',{Name='BTB_FlightOrientation',Attachment0=ba,Mode=Enum.OrientationAlignmentMode.OneAttachment,MaxTorque=math.huge,Responsiveness=25},a9)D={attachment=ba,velocity=bb,orientation=bc,root=a9,humanoid=a8}end ay(y.movement,a8,'PlatformStand',true) ay(y.movement,a8,'AutoRotate',false)local ba=f.CurrentCamera local bb=Vector3.zero if ba and(o or not m.PauseUnfocused)and not c:GetFocusedTextBox()then local function bc(bd)return c:IsKeyDown(bd)and 1 or 0 end local bd=bc(Enum.KeyCode.W)-bc(Enum.KeyCode.S)local be=bc(Enum.KeyCode.D)-bc(Enum.KeyCode.A)local bf=bc(Enum.KeyCode.Space)-math.max(bc(Enum.KeyCode.LeftControl),bc(Enum.KeyCode.RightControl))bb=ba.CFrame.LookVector*bd+ba.CFrame.RightVector*be+Vector3.yAxis*bf if bb.Magnitude>1 then bb=bb .Unit end end D.velocity.VectorVelocity=bb*m.FlySpeed if ba then local bc=ba.CFrame.LookVector*Vector3.new(1,0,1)if bc.Magnitude>0.001 then D.orientation.CFrame=CFrame.lookAt(Vector3.zero,bc)end end end aw(b.PreSimulation,function()if not n then return end local a7=aK(k)if m.Noclip and not an.joining and a7 and not aS(a7)then for a8 in pairs(r)do if a8.Parent then ay(y.collision,a8,'CanCollide',false)end end end a6()end)aw(c.JumpRequest,function()if not n or not m.InfiniteJump or m.Fly or c: GetFocusedTextBox()or(m.PauseUnfocused and not o)or ak()-ac<0.16 then return end local a7,a8,a9=aK(k)if not aT(a7,a8,a9)or a8.PlatformStand then return end ac=ak()local ba=a8.UseJumpPower and a8.JumpPower or math.sqrt(2*f.Gravity*math.max(a8.JumpHeight,0))a8:ChangeState(Enum.HumanoidStateType.Jumping)a9.AssemblyLinearVelocity=Vector3.new(a9.AssemblyLinearVelocity.X,ba,a9.AssemblyLinearVelocity.Z)end)local function a7(a8)local a9,ba,bb=aK(k)if not aT(a9,ba,bb)then return false, 'Character cannot move right now'end local bc=bb.CFrame:ToObjectSpace(a9:GetPivot())a9:PivotTo(a8*bc)bb.AssemblyLinearVelocity,bb.AssemblyAngularVelocity=Vector3.zero,Vector3.zero return true end function an.scanQueues()an.nextScan=ak()+0.75 for a8,a9 in pairs(an.queueCooldowns)do if not a8.Parent or ak()>=a9 then an.queueCooldowns[a8]=nil end end local a8=f:FindFirstChild('DuelTeleportHelper')local a9,ba={},{}for bb,bc in ipairs(a:GetPlayers())do a9[tostring(bc.UserId)]='@'..bc.Name end for bb, bc in ipairs(a8 and a8:GetChildren()or{})do local bd=tonumber(bc:GetAttribute('TeamSize'))if bd and bd>=1 and bd<=5 and bd==math.floor(bd)then local be={object=bc,size=bd,capacity=bd*2,count=0,mine=false,members={},slots=0,teams={},destination=bc:GetAttribute('TeleportPivot')}local bf={}for bg,bh in ipairs({'Team1','Team2'})do local bi=bc:FindFirstChild(bh)local bj={name=bh,count=0,slots=0}table.insert(be.teams,bj)for bk,bl in ipairs(bi and bi:GetChildren()or{})do be.slots+=1 bj.slots+=1 local bm=tonumber(bl:GetAttribute('UserId'))if bm and bm>0 then bj.count+=1 end if bm and bm>0 and not bf[bm]then bf[bm],be.count=true,be.count+1 be.mine=be.mine or bm==k.UserId table.insert(be.members,a9[tostring(bm)]or('User '..tostring(bm)))end end end table.sort(be.members)table.insert(ba,be)end end table.sort(ba,function(bb,bc)local bd,be=bb.count/bb.capacity,bc.count/bc.capacity if bd~=be then return bd>be end return bb.object.Name=bf.capacity and' (full)'or'',#bf.members>0 and table.concat(bf.members,', ')or'empty'))end end bc:Set(#bd>0 and table.concat(bd,'\n')or(bb..'v'..bb..': no queue data loaded'))end end function an.leaveQueue(a8)local a9=an.joining an.joining=nil if a9 and a9.character==k.Character then local ba,bb,bc=aK(k )if bb and bc then bb:MoveTo(bc.Position)end a5()end if a8 and a9 and a9.character==k.Character and not aM()then a7(a9.origin)end end function an.queuePad(a8)local a9=aJ(f,'Lobby_Folder','NewDuels',a8.object.Name)local ba,bb for bc,bd in ipairs(a8.teams)do local be=aJ(a9,bd.name..'Pad','Pad','TouchDetector')if bd.count=a8.size and be and be:IsA('BasePart')and be.CanTouch and(not bb or bd.count=a8.nextMove then a0()aB(y.collision)bb.Sit=false local bg=bd.Size.Y*0.5+bc.Size.Y*0.5+math.max(bb.HipHeight,0)+0.2 local bh=bd.CFrame*CFrame.new(0,bg,0)if a7(bh)then a8.destination=bh end a8.nextMove=ak()+2 end bb:MoveTo(bd.Position)an. status='Joining '..a9.object.Name..' '..be..' | on pad; waiting for your slot'end function an.queueTick()if not m.AutoRun or aM()then return end if ak()>=an.nextScan then an.scanQueues()end local a8,a9,ba=aK(k)if not ba then an.status='Waiting for lobby character'return end local bb for bc,bd in ipairs(an.queues)do if bd.mine then bb=bd break end end if ak()>=an.nextQueueCheck then an.nextQueueCheck=ak()+10 an.scanQueues()bb=nil for bc,bd in ipairs(an.queues)do if bd.mine then bb=bd break end end local bc,bd,be=nil,math.huge,-1 if bb then bc,bd,be=bb,math.max(0,bb.capacity-bb.count),bb.count/bb.capacity end for bf,bg in ipairs(an.queues)do local bh=bg.size..'v'..bg.size if not bg.mine and(m.QueueMode=='Any populated'or m.QueueMode==bh)and bg.count=bg.capacity and(bg.count>0 or m.JoinEmpty)and ak()>=(an.queueCooldowns[bg.object]or 0)then local bi=bg.capacity-bg.count-1 local bj=bg.count/bg.capacity if bibe)then bc,bd,be=bg,bi, bj end end end if bc and bc~=bb then local bf=an.joining if not bf or bf.queue~=bc.object then local bg=bf and bf.origin or ba.CFrame an.leaveQueue(false)an.joining={queue=bc.object,origin=bg,character=k.Character,started=ak(),nextMove=0}a5()if not an.queuePad(bc)and tostring(typeof(bc.destination))=='CFrame'then a7(bc.destination)end an.enterQueuePad(an.joining,bc)return end end end local bc=' | next queue check in '..math.max(0,math.ceil(an.nextQueueCheck-ak()))..'s'if bb and(not an.joining or an.joining.queue==bb.object)then if an.joining then an.joining.confirmed=true end an.status='Queued: '..bb.object.Name..' | waiting for round start'..bc return end if an.joining then local bd=an.joining if bd.confirmed then bd.confirmed,bd.started,bd.nextMove=false,ak(),0 end local be for bf,bg in ipairs(an.queues)do if bg.object==bd.queue then be=bg break end end if ak()-bd.started>8 or not bd.queue.Parent or not be or be.count>=be.capacity then an.queueCooldowns[bd.queue]=ak()+1 an.leaveQueue( true)an.status='Queue entry not confirmed; waiting for next check'..bc return end an.enterQueuePad(bd,be)return end an.status='Waiting for a populated queue with space'..bc end function an.stopHiding(a9)local ba=an.hide an.hide=nil if not ba then return false end ba.velocity:Destroy()ba.attachment:Destroy()local bb=aM()if a9 and k.Character==ba.character and bb and bb.id==ba.gameId then a7(ba.origin)end return true end function an.mapBounds(a9)local ba=a9 and a9.world and a9.world: FindFirstChild('Map')if not ba then return nil end if an.bounds and an.bounds.map==ba then return an.bounds end local bb,bc for bd,be in ipairs(ba:GetDescendants())do if be:IsA('BasePart')then local bf,bg=be.Position,be.Size.Magnitude*0.5 local bh,bi=bf-Vector3.one*bg,bf+Vector3.one*bg bb=bb and Vector3.new(math.min(bb.X,bh.X),math.min(bb.Y,bh.Y),math.min(bb.Z,bh.Z))or bh bc=bc and Vector3.new(math.max(bc.X,bi.X),math.max(bc.Y,bi.Y),math.max(bc.Z,bi.Z))or bi end end if not bb then return nil end an.bounds={map=ba,center=(bb+bc)*0.5,radius=(bc-bb).Magnitude*0.5}return an.bounds end function an.playerDistance(a9)local ba=math.huge for bb,bc in ipairs(a:GetPlayers())do local bd=bc.Character local be=bd and bd:FindFirstChild('HumanoidRootPart')if bc~=k and be and be:IsA('BasePart')and be:IsDescendantOf(f)then ba=math.min(ba,(be.Position-a9).Magnitude)end end return ba end function an.hideTick(a9)local ba,bb,bc=aK(k)if not aT(ba,bb,bc)then an.stopHiding(false)an.status= 'Baby: waiting until free to move'return end local bd=an.mapBounds(a9)if not bd then an.status='Baby: waiting for map geometry'return end local be=math.max(400,m.HideDistance)local bf=an.hide if bf and(bf.character~=ba or bf.gameId~=a9.id)then an.stopHiding(false)bf=nil end local bg=bf and bf.point if not bg or an.playerDistance(bg)=be+50 then bg=bl break end end if not bg then for bj,bk in ipairs(a:GetPlayers())do local bl=bk.Character and bk.Character:FindFirstChild('HumanoidRootPart')if bk~=k and bl and bl:IsA('BasePart')then bh=math.max(bh,(bl.Position-bd.center).Magnitude+be+100)end end bg=Vector3.new(bd.center.X+bh,bi,bd.center.Z)end end if not bf then local bh=bc.CFrame a0()local bi=as('Attachment',{Name= 'BTB_Hide'},bc)local bj=as('LinearVelocity',{Name='BTB_HideHover',Attachment0=bi,RelativeTo=Enum.ActuatorRelativeTo.World,MaxForce=math.huge,VectorVelocity=Vector3.zero},bc)bf={character=ba,gameId=a9.id,origin=bh,point=bg,attachment=bi,velocity=bj}an.hide=bf end bf.point=bg if(bc.Position-bg).Magnitude>2 then a7(CFrame.new(bg))end an.status=string.format('Baby: hiding outside the map | nearest player %s studs',tostring(math.floor(an.playerDistance(bc.Position))))end local function a9(ba,bb)local bc=aV(ba)local bd,be,bf=aK(k)if not bc or not bf then return nil end local bg=(bf.Position-bc)*Vector3.new(1,0,1)if bg.Magnitude<0.01 then bg=Vector3.zAxis end local bh=bb or ba.MaxActivationDistance local bi=math.max(0.5,math.min(2.5,bh*0.5))local bj=bc+bg.Unit*bi local bk=RaycastParams.new()bk.FilterType=Enum.RaycastFilterType.Exclude bk.FilterDescendantsInstances={k.Character,av}local bl=f:Raycast(bj+Vector3.new(0,4,0),Vector3.new(0,-12,0),bk)if bl and bl.Normal.Y>0.5 then local bm,bn=aK(k) local bo=math.max(2,bn.HipHeight+bf.Size.Y*0.5)local bp=Vector3.new(bj.X,bl.Position.Y+bo,bj.Z)if(bp-bc).Magnitudebj.MaxActivationDistance then bk.completed=false end end end local function bf(bh,bi,bj,bk,bl,bm)local bn,bo,bp=aK(k)if not bn or(not bl and not aN(k,bi))or aS(bn)or bn:GetAttribute( 'CantUseProximities')or bn:GetAttribute('Server_CantUseProximities')or not d.Enabled or not bh.Parent or(not bh.Enabled and not bm)or bh:GetAttribute('PlayerToolsIgnore')==true or bh:GetAttribute('Disabled')or(bh:GetAttribute('Obstructed')and not bm)or bh:GetAttribute('Exclude')==k.Name then return nil end local bq,br=aV(bh)if not bq then return nil end local bs=(bp.Position-bq).Magnitude if bk then return bs end if bs>math.min(bj or math.huge,bh.MaxActivationDistance)then return nil end if bh. RequiresLineOfSight then local bt=f.CurrentCamera if not bt then return nil end local bu=RaycastParams.new()bu.FilterType=Enum.RaycastFilterType.Exclude bu.FilterDescendantsInstances={bn,av}local bv=f:Raycast(bt.CFrame.Position,bq-bt.CFrame.Position,bu)if bv and bv.Instance~=br and not bv.Instance:IsDescendantOf(br)then return nil end end return bs end local bh local function bi(bj,bk,bl,bm,bn,bo)local bp,bq,br=nil,nil,math.huge for bs,bt in pairs(s)do local bu,bv=aZ(bs,bk)if bu=='rescue'then bv =bv or bh(bs,bk)end if bu==bj and ak()>=bt.nextTry and(bj~='oven'or G==nil or G==bs)then local bw=bv and bv.Character local bx=bj~='grab'or(bw and not aS(bw))if bj=='rescue'then bx=bw and bw:GetAttribute('IsTrapped')end if bo and not bo[bv]then bx=false end if bx then local by=bf(bs,bk,bl,bm,false,bn)if by and by
=15 then an.catchCooldowns[bq.target]=ak()+20 bl(false,'Catch stalled; trying another baby before retrying this one')return end local bs,bt,bu=aK(bq.target)if not bs or bs~=bq.targetCharacter or bq.target.Parent~=a or aO(k)~='Baker'or aO(bq.target)~='Baby'or aQ(bq.target,br)~='enemy'or bs:GetAttribute('IsTrapped')then bl(false,'Baby unavailable; catch stopped')return end if bs:GetAttribute('IsCarried')then bq.carriedAt=bq.carriedAt or ak()if ak()-bq.carriedAt>2.5 then bl(false,'Baby is carried; your hold was not confirmed')end return end bq.carriedAt=nil local bv=bq.prompt if not bv or not bv.Parent or not bv:IsDescendantOf(bs)then bo(bq)bv,bq.prompt=nil,nil for bw,bx in ipairs(bs:GetDescendants())do if bx: IsA('ProximityPrompt')and aZ(bx,br)=='grab'then ba(bx)bv,bq.prompt=bx,bx break end end end local bw=4 local bx=aJ(g,'General_Settings','Catch_System','Proximity')local by=bx and bx:GetAttribute('Distance')if type(by)=='number'and by>0 then bw=by end if bv then local bz=y.prompt[bv]local bA=bz and bz.MaxActivationDistance bw=math.min(bw,bA and bA.original or bv.MaxActivationDistance)end if ak()>=bq.nextMove then local bz=bv and a9(bv,bw)or CFrame.new(bu.Position+Vector3.new(2,0,0))if not bz or not a7(bz)then bl(false,'Character cannot follow baby')return end bq.nextMove=ak()+z.catchTeleport end local bz=bv and bf(bv,br,bw)if bq.inputError then bo(bq)bq.startAt=ak()+1 elseif bq.phase=='hold'then local bA=bq.thread and coroutine.status(bq.thread)~='dead'if bA then if ak()>=bq.deadline then bo(bq)end elseif bq.triggered or ak()>=bq.holdEnds then pcall(function()bv:InputHoldEnd()end)bq.phase='verify'bq.deadline=math.max(bq.attemptAt+z.catchAttempt,bq.holdEnds)end end if bq.phase=='verify' and ak()>=bq.deadline then bo(bq)end if bq.phase=='approach'and ak()>=bq.startAt and bz then bq.attempts+=1 bm(bq)end local bA=not bv and'waiting for Catch prompt'or not d.Enabled and'game prompts paused'or bq.character:GetAttribute('Server_CantUseProximities')and'game has blocked interactions'or bq.character:GetAttribute('CantUseProximities')and'character interactions paused'or bv:GetAttribute('Disabled')and'Catch prompt disabled by game'or bv:GetAttribute('Obstructed')and 'Catch prompt obstructed'or not bv.Enabled and'Catch prompt not enabled'or not bz and'waiting for prompt range / line of sight'or bq.phase=='verify'and'waiting for holding confirmation'or'following and catching'aH(string.format('@%s: %s | attempt %d | H: stop',bq.target.Name,bA,bq.attempts))end local function bq(br)if B or ak()=(an.catchCooldowns[by]or 0))then local bC=(bu.Position-bB.Position).Magnitude if bC0 then bA=math.min(bA,bC)end local bD=bf(bs,bv,nil,bw==true,false,bw)if bD and(bw or bD>bA*0.85)then local bE=a9(bs,bA)local bF=bE and a7(bE)if not bF then bl(false,'Could not reach the target')return false end bx.phase,bx.startAt,bx.deadline='approach',ak()+0.4,ak()+2.4 bx.approachRange=bA aH(({grab='Catching baby...',rescue='Saving baby from oven...',oven= 'Putting baby in oven...'})[bt])return true end end bm(bx)return true end function an.ovenObject(bs,bt)local bu=bt and aJ(bt.world,'Map','Resettable','Traps')if bu and bs and bs:IsDescendantOf(bu)then while bs.Parent~=bu do bs=bs.Parent end end return bs end function an.siteContains(bs,bt)return bt and(bt==bs.object or bt:IsDescendantOf(bs.object))end function an.clearOvenOccupants()for bs,bt in pairs(an.ovenOccupants)do bt.connection:Disconnect()end table.clear(an.ovenOccupants)table.clear(an. ovenApproaches)end function an.rememberOven(bs,bt,bu,bv)local bw=an.ovenOccupants[bs.object]if bw then bw.connection:Disconnect()end local bx={player=bt,character=bu,world=bv.world,gameId=bv.id}an.ovenOccupants[bs.object]=bx bx.connection=bu:GetAttributeChangedSignal('IsTrapped'):Connect(function()if not bu:GetAttribute('IsTrapped')then bx.connection:Disconnect()if an.ovenOccupants[bs.object]==bx then an.ovenOccupants[bs.object]=nil end end end)end function an.ovenPosition(bs)local bt=bs.object if not bt or not bt.Parent then return nil end if bt:IsA('ProximityPrompt')then return aV(bt)end for bu in pairs(v)do if an.siteContains(bs,bu)and bu.Parent:IsA('BasePart')then return bu.Parent.Position end end for bu,bv in ipairs(bt:GetDescendants())do if bv:IsA('BasePart')and aX(aW(bv.Name),{'touchdetector','depositpoint','trigger'})then return bv.Position end end if bt:IsA('Model')then return bt:GetPivot().Position end if bt:IsA('BasePart')then return bt.Position end return nil end function an.ovenFront(bs,bt)local bu=bs.object local bv=bt and aV(bt)or an.ovenPosition(bs)if not bv then return nil end local bw=bu if bu:IsA('ProximityPrompt')then local bx=bt.Parent if bx and bx:IsA('Attachment')then bx=bx.Parent end if not bx or not bx:IsA('BasePart')then return nil end bw=bx.Parent and bx.Parent:IsA('Model')and bx.Parent.Name~='Map'and bx.Parent or bx end local bx={standpoint=5,approachpoint=5,depositposition=5,frontpoint=4,frontattachment=4,depositpoint=4,frontdoor=3,ovendoor=3, door=3,opening=3,entrance=3,doorhandle=2,handle=2}local function by(bz)return(aW(bz.Name):gsub('%d+$',''))end local bz=bw:GetDescendants()if bw:IsA('BasePart')then table.insert(bz,1,bw)end local bA,bB,bC,bD,bE={},{},{},nil,-1 for bF,bG in ipairs(bz)do local bH=bx[by(bG)]if bH and(bG:IsA('BasePart')or bG:IsA('Attachment')or bG:IsA('Model'))then table.insert(bC,{object=bG,score=bH})end if bG:IsA('BasePart')then table.insert(bB,bG)local bI,bJ=false,bG while bJ and bJ~=bw do local bK=by(bJ)if bx[bK] or aX(bK,{'guide','trigger','detector','hitbox','highlight'})then bI=true break end bJ=bJ.Parent end if not bI and(bG.Transparency or 0)<0.99 then table.insert(bA,bG)end end end if#bA==0 then bA=bB end for bF,bG in ipairs(bA)do local bH=bG.Size.X*bG.Size.Y*bG.Size.Z if bH>bE then bD,bE=bG,bH end end if not bD then return nil end local bF=bD.CFrame local bG=bF.LookVector*Vector3.new(1,0,1)if bG.Magnitude<0.01 then bG=bF.UpVector*Vector3.new(1,0,1)end local bH,bI,bJ=CFrame.lookAt(bF.Position,bF. Position+bG.Unit),nil,nil for bK,bL in ipairs(bA)do for bM,bN in ipairs({-1,1})do for bO,bP in ipairs({-1,1})do for bQ,bR in ipairs({-1,1})do local bS=bH:PointToObjectSpace(bL.CFrame:PointToWorldSpace(bL.Size*Vector3.new(bN,bP,bR)*0.5))bI=bI and Vector3.new(math.min(bI.X,bS.X),math.min(bI.Y,bS.Y),math.min(bI.Z,bS.Z))or bS bJ=bJ and Vector3.new(math.max(bJ.X,bS.X),math.max(bJ.Y,bS.Y),math.max(bJ.Z,bS.Z))or bS end end end end local bK,bL=bH*CFrame.new((bI+bJ)*0.5),bJ-bI local bM={}local function bN(bO,bP,bQ,bR,bS,bT,bU)bP*=Vector3.new(1,0,1)if bP.Magnitude<0.01 then return end bP=bP.Unit for bV,bW in ipairs(bM)do if bW.outward:Dot(bP)>0.98 then return end end table.insert(bM,{anchor=bO,outward=bP,reason=bQ,exact=bR,trusted=bS,learned=bT,preferredGap=bU,reference=bD,localAnchor=bF:PointToObjectSpace(bO),localOutward=bF:VectorToObjectSpace(bP)})end local function bO(bP)local bQ=bK:PointToObjectSpace(bP)if Vector3.new(bQ.X,0,bQ.Z).Magnitude<0.3 then return nil end if math.abs(bQ.X)/math. max(bL.X,0.1)>math.abs(bQ.Z)/math.max(bL.Z,0.1)then return bK.RightVector*(bQ.X>=0 and 1 or-1)end return bK.LookVector*(bQ.Z<=0 and 1 or-1)end local function bP(bQ)local bR=(math.abs(bQ:Dot(bK.RightVector))*bL.X+math.abs(bQ:Dot(bK.UpVector))*bL.Y+math.abs(bQ:Dot(bK.LookVector))*bL.Z)*0.5 return Vector3.new(bK.Position.X,bv.Y,bK.Position.Z)+bQ*bR end local bQ=an.ovenApproaches[bu]if bQ and bQ.reference.Parent and(bQ.reference==bw or bQ.reference:IsDescendantOf(bw))then local bR=bQ.reference. CFrame bN(bR:PointToWorldSpace(bQ.localAnchor),bR:VectorToWorldSpace(bQ.localOutward),'confirmed placement',bQ.exact,true,true,bQ.gap)end table.sort(bC,function(bR,bS)if bR.score~=bS.score then return bR.score>bS.score end return bR.object:GetFullName()1 and(2+(bz-by)%(#bt-1))or 1 local bB=bt[bA]if not bB.reference.Parent then bs.frontOptions=nil return nil end local bC=bB.reference.CFrame local bD={anchor=bC:PointToWorldSpace(bB.localAnchor),outward=bC:VectorToWorldSpace(bB.localOutward),reference=bB.reference,localAnchor=bB.localAnchor,localOutward=bB.localOutward,exact=bB.exact,trusted=bB.trusted,reason=bB.reason}local bE=bB.preferredGap or 1.5 if bA==1 and bz==1 and by==2 then bE=math.max( 0.35,bE*0.5)end bD.gap=bE local bF=bD.anchor+bD.outward*(bD.exact and 0 or bE)local bG=RaycastParams.new()bG.FilterType=Enum.RaycastFilterType.Exclude local bH={av,bs.site.object}for bI,bJ in ipairs(a:GetPlayers())do if bJ.Character then table.insert(bH,bJ.Character)end end bG.FilterDescendantsInstances=bH local bI=math.max(2,bv.HipHeight+bw.Size.Y*0.5)local bJ=f:Raycast(bF+Vector3.new(0,5,0),Vector3.new(0,-18,0),bG)if bJ and bJ.Normal.Y>0.5 then bF=Vector3.new(bF.X,bJ.Position.Y+bI,bF.Z)end bs. frontReason,bs.frontIndex,bs.lastPose=bD.reason,bA,bD return CFrame.lookAt(bF,bF-bD.outward)end function an.scanOvens(bs)for bt,bu in pairs(an.ovenCooldowns)do if not bt.Parent or ak()>=bu then an.ovenCooldowns[bt]=nil end end for bt,bu in pairs(an.catchCooldowns)do if bt.Parent~=a or ak()>=bu then an.catchCooldowns[bt]=nil end end if an.ovenWorld~=(bs and bs.world)then an.clearOvenOccupants()table.clear(an.ovenCooldowns)end for bt,bu in pairs(an.ovenApproaches)do if not bt.Parent or not bu. reference.Parent then an.ovenApproaches[bt]=nil end end an.ovens,an.ovenWorld,an.nextOvenScan={},bs and bs.world,ak()+0.75 for bt,bu in pairs(an.ovenOccupants)do if not bt.Parent or bu.player.Character~=bu.character or bu.player.Parent~=a then bu.connection:Disconnect()an.ovenOccupants[bt]=nil end end if not bs or not bs.world then return end local bt={}local function bu(bv)bv=an.ovenObject(bv,bs)if not bv or bt[bv]or not bv:IsDescendantOf(bs.world)or aU(bv)then return end local bw={object=bv}if an.ovenPosition(bw)then bt[bv]=true table.insert(an.ovens,bw)end end local bv=aJ(bs.world,'Map','Resettable','Traps')for bw,bx in ipairs(bv and bv:GetChildren()or{})do if bx:IsA('Model')or bx:IsA('BasePart')then bu(bx)end end for bw in pairs(v)do if bw.Parent then bu(bw.Parent.Parent)end end for bw in pairs(s)do if aZ(bw,bs)=='oven'then local bx=false for by in pairs(bt)do if bw:IsDescendantOf(by)then bx=true break end end if not bx then bu(bw)end end end end function an.sitePrompt(bs,bt)local bu,bv=nil,math.huge local bw=an.ovenPosition(bs)for bx in pairs(s)do if(bx==bs.object or bx:IsDescendantOf(bs.object))and aZ(bx,bt)=='oven'and(m.AutoRun or not G or bx==G)then local by=aV(bx)local bz=by and bw and(by-bw).Magnitude or math.huge if bz0)then return true end bv.connection:Disconnect()an.ovenOccupants[bs.object]=nil end for bw in pairs(v)do if an.siteContains(bs,bw)and bw:GetAttribute('Blocked')then return true end end for bw in pairs(w)do if bw:GetAttribute('Enabled')and bw:IsDescendantOf(bt.world)and(an.siteContains(bs,bw)or bw:GetAttribute('TrapName')==bs.object.Name) then return true end end for bw,bx in ipairs(a:GetPlayers())do local by,bz,bA=aK(bx)if by and aN(bx,bt)and by:GetAttribute('IsTrapped')and((bA.Position-bu).Magnitude<12 or by:GetAttribute('TrapName')==bs.object.Name)then return true end end return false end function an.pickOven(bs,bt)if an.ovenWorld~=(bs and bs.world)or ak()>=(an.nextOvenScan or 0)then an.scanOvens(bs)end local bu,bv,bw=aK(k)if not bw then return nil end local bx,by,bz=nil,nil,math.huge for bA,bB in ipairs(an.ovens)do local bC= an.ovenPosition(bB)local bD=an.sitePrompt(bB,bs)local bE=m.AutoRun or not G or bD==G if bD then bE=bE and bf(bD,bs,nil,bt,false,bt)~=nil elseif not bt then bE=false end if bC and bE and ak()>=(an.ovenCooldowns[bB.object]or 0)and not an.siteOccupied(bB,bs)then local bF=(bw.Position-bC).Magnitude if(bD and not by)or((bD~=nil)==(by~=nil)and bF0 and'Baker: waiting for a free oven'or'Baker: waiting for ovens to load'end return false end local bx={kind='oven',delivery=true,site=bv,prompt=bw,character=k.Character,gameId=bs.id,target=bk(bs),phase='approach',started=ak(),startAt=ak()+0.4,attempts=0,nextMove=0,travel=bt,trappedBefore={},positionAttempt=0,positionSince=ak()}local by,bz=aK(k)bx.humanoid=bz bx.targetCharacter=bx.target and bx.target.Character for bA,bB in ipairs(a:GetPlayers())do if bB.Character and bB.Character:GetAttribute('IsTrapped')then bx.trappedBefore[bB]=true end end if bt and not bn(bx,bs)then return false end B=bx if bt then a0()ay(y.movement,bz,'AutoRotate',false)end an.tickDelivery(bx,bs)return B==bx end function an.tickDelivery(bs,bt)local bv=an.ovenPosition(bs.site)local bw=aR(bs.character)if not bw then local bx,by for bz,bA in ipairs(a:GetPlayers())do local bB,bC,bD=aK(bA)if bB and aN(bA,bt)and bB:GetAttribute( 'IsTrapped')and not bs.trappedBefore[bA]and((bs.target==bA and bB==bs.targetCharacter)or(not bs.target and bv and(bD.Position-bv).Magnitude<30))then bx,by=bA,bB break end end if bx then local bz=bs.lastPose if bz and bs.lastDestination and bz.reference.Parent then an.ovenApproaches[bs.site.object]={reference=bz.reference,localAnchor=bz.localAnchor,localOutward=bz.localOutward,exact=bz.exact,gap=bz.gap}end an.rememberOven(bs.site,bx,by,bt)bl(true,'Baby confirmed in oven')return end bs.carryLostAt =bs.carryLostAt or ak()if ak()-bs.carryLostAt>2 then bl(false,'Carry ended; oven placement was not confirmed')end return end if not bv or not bt or not bt.world or not bs.site.object:IsDescendantOf(bt.world)or aO(k)~='Baker'or aS(bs.character)then bl(false,'Oven or character unavailable')return end if bs.targetCharacter and bs.targetCharacter:GetAttribute('IsTrapped')and not bs.trappedBefore[bs.target]then bs.trapSeenAt=bs.trapSeenAt or ak()if ak()-bs.trapSeenAt>2 then bl(false, 'Baby trapped; waiting for carry state to clear')end return end if an.siteOccupied(bs.site,bt)then an.ovenCooldowns[bs.site.object]=ak()+1 local bx,by=an.pickOven(bt,bs.travel)if not bx then bl(false,'All ovens occupied; waiting for a free oven')return end bo(bs)bs.site,bs.prompt=bx,by bs.started,bs.nextMove,bs.startAt,bs.attempts=ak(),0,ak()+0.4,0 bs.positionAttempt,bs.positionSince=0,ak()bs.frontOptions,bs.lastPose,bs.lastDestination=nil,nil,nil bv=an.ovenPosition(bx)aH( 'Oven filled; switching to '..bx.object.Name)end if ak()-bs.started>=7 then an.ovenCooldowns[bs.site.object]=ak()+8 bl(false,'Oven did not confirm placement; trying another oven')return end local bx=bs.prompt if not bx or not bx.Parent then local by=an.sitePrompt(bs.site,bt)if by~=bx then bo(bs)bs.prompt,bx=by,by bs.frontOptions,bs.positionAttempt=nil,0 end end if bs.travel and ak()>=bs.nextMove then local by=an.ovenDestination(bs)if not by or not a7(by)then bl(false,'Could not reach oven') return end bs.lastDestination=by bs.nextMove=ak()+0.15 end if bs.inputError then bo(bs)bs.startAt=ak()+1 end if bx then if bs.phase=='approach'and ak()>=bs.startAt and bf(bx,bt)then bs.attempts+=1 bm(bs)elseif bs.phase=='hold'and(bs.sent or bs.triggered or ak()>=bs.holdEnds)then pcall(function()bx:InputHoldEnd()end)bs.phase,bs.deadline='verify',ak()+(bs.lastPose and not bs.lastPose.trusted and 1.2 or 2)elseif bs.phase=='verify'and ak()>=bs.deadline then bo(bs)an.advanceOvenApproach(bs)elseif bs. phase=='approach'and ak()-bs.positionSince>=1.2 and not bf(bx,bt)then an.advanceOvenApproach(bs)bs.startAt=ak()+0.4 end aH('Oven: '..bs.site.object.Name..' | approach '..(bs.frontIndex or 1)..': '..(bs.frontReason or'waiting')..' | waiting for placement | attempt '..bs.attempts)else if ak()-bs.positionSince>=1.2 then an.advanceOvenApproach(bs)end aH('Oven: '..bs.site.object.Name..' | approach '..(bs.frontIndex or 1)..': '..(bs.frontReason or'waiting')..' | waiting for placement')end end aw(d. PromptTriggered,function(bs,bt)if bt~=k then return end if B and B.prompt==bs then B.triggered=true end end)local function bs(bt)local bv=B if not bv then return end if(bt and bt.id)~=bv.gameId or k.Character~=bv.character or not aK(k)then a_(true)return end if bv.delivery then an.tickDelivery(bv,bt)return end local bw=aR(bv.character)local bx=bv.targetCharacter local by=bv.target and bv.target.Parent==a and bv.target.Character==bx if bv.kind=='grab'and bw then bl(true, 'Baby held \u{2014} ready for oven')return elseif bv.kind=='oven'and not bw then if not bx or(by and bx:GetAttribute('IsTrapped'))then bl(true,bx and'Baby placed in oven'or'Oven input finished; carry cleared')return end elseif bv.kind=='rescue'and by and not bx:GetAttribute('IsTrapped')then bl(true,'Teammate rescued')return end if aS(bv.character)then bl(false,'Interaction paused while carried or trapped')return end if bv.chase then bp(bv,bt)return end if bv.inputError then bl(false, 'Prompt input failed: '..bv.inputError)return end if bv.phase~='verify'then if(bv.kind=='grab'and(aO(k)~='Baker'or not by or aQ(bv.target,bt)~='enemy'))or(bv.kind=='rescue'and(aO(k)~='Baby'or not by or aQ(bv.target,bt)~='ally'))or(bv.kind=='oven'and aO(k)~='Baker')then bl(false,'Role or target changed; interaction cancelled')return end if bv.kind=='grab'and bx and aS(bx)then bl(false,'Target was already caught; interaction cancelled')return end end if bv.phase=='approach'then local bz=bf(bv. prompt,bt)if ak()>=bv.startAt and bz and bz<=bv.approachRange then bm(bv)elseif ak()>=bv.deadline then bl(false,'Target unavailable after teleport')end return end if bv.phase=='hold'then local bz=bf(bv.prompt,bt,nil,false,bv.kind=='prompt')if bv.kind=='prompt'and not bc(bv.prompt,bt)then bz=nil end if not bz and bv.prompt.Parent and not bv.triggered and not bv.sent then bl(false,'Prompt moved out of reach or became unavailable')return end if bv.triggered or bv.sent or ak()>=bv.holdEnds then pcall(function()bv.prompt:InputHoldEnd()end)if bv.kind=='prompt'then bl(true,'Prompt input sent: '..bv.prompt.ActionText)return end bv.phase,bv.deadline='verify',ak()+2 end end if bv.kind=='prompt'and bv.phase=='verify'and(bv.triggered or bv.sent)then bl(true,'Prompt input sent')return end if ak()>=bv.deadline then bl(false,bv.kind=='oven'and not bw and'Carry cleared; oven placement unconfirmed'or'No game confirmation; input cooldown active')end end local function bt(bv)if not m.AutoPrompts or B then return end local bw,bx=nil,math.huge for by,bz in pairs(s)do if bc(by,bv)and ak()>=bz.nextTry and(m.RepeatPrompts or not bz.completed)and(not m.OnlyEPrompts or by.KeyboardKeyCode==Enum.KeyCode.E)then local bA=bf(by,bv,nil,false,true)if bA and bA=ab then aH('Holding baby \u{2014} waiting for an available oven or trap in this match')end return end elseif by=='Baker'then if m.AutoGrab or m.AutoRun then if not bq(bw)and m.AutoRun then an.status='Baker: no free enemy babies; waiting for round result'end end elseif by=='Baby'and(m.AutoRescue or X)then local bz,bA=bi('rescue',bw,nil,true,true,X)if bz then if br(bz,'rescue',bA,bw,true)and X then X[bA]=nil end elseif X then X=nil aH('Rescue sweep finished',3)end end bt(bw)end local function bw(bx)local by=bx=='rescue'and'Baby'or'Baker'if aO(k)~=by then aI(by=='Baby'and'Use rescue while playing as a baby'or'Use this while playing as a baker')return end if B or ak()=(an.nextOvenScan or 0)then an.scanOvens(bA)end for bI,bJ in ipairs(an.ovens)do local bK=bJ.object local bL,bM=an.ovenPosition(bJ),nil if bK:IsA('ProximityPrompt')then local bN bN,bM=aV(bK)elseif bK:IsA('BasePart')then bM=bK else for bN,bO in ipairs(bK:GetDescendants())do if bO: IsA('BasePart')then bM=bO break end end end if bL and bM and(bL-bD.Position).Magnitude<=m.ESPDistance then bH+=1 bG[bK]=true if not u[bK]then u[bK]=bx('BTB_Oven')end local bN=string.format('Oven / trap \u{b7} %d studs%s',math.floor((bL-bD.Position).Magnitude),an.siteOccupied(bJ,bA)and' | occupied'or'')by(u[bK],bM,bM,Color3.fromRGB(255,173,75),bN,bH<=4)end end end for bI,bJ in pairs(u)do if not bG[bI]then a1(bJ)u[bI]=nil end end end local function bA()local bC,bD,bE=aK(k)if not o or A. renderDisabled or not m.ShowPickupRange or not m.ExpandPickup or aO(k)~='Baker'or not bE then if C then C:Destroy()C=nil end return end if not C then C=as('Part',{Name='BTB_PickupRadius',Shape=Enum.PartType.Ball,Anchored=true,CanCollide=false,CanTouch=false,CanQuery=false,CastShadow=false,Transparency=0.93,Material=Enum.Material.ForceField,Color=Color3.fromRGB(255,164,74)},av)end C.Size=Vector3.one*m.PickupRadius*2 C.CFrame=CFrame.new(bE.Position)end local function bD()if m.Fullbright then for bE,bF in pairs({Brightness=2,ClockTime=14,FogEnd=100000,Ambient=Color3.fromRGB(200,200,200),OutdoorAmbient=Color3.fromRGB(200,200,200)})do ay(y.lighting,h,bE,bF)end else aB(y.lighting)end local bE=f.CurrentCamera local bF={}for bG in pairs(y.camera)do if bG~=bE or not m.CustomFOV then table.insert(bF,bG)end end for bG,bH in ipairs(bF)do aA(y.camera,bH)end if m.CustomFOV and bE then ay(y.camera,bE,'FieldOfView',m.FOV)end end local function bE(bF,bG)local bH,bI,bJ,bK=aM(),aK(k)if not bK then return nil end local bL,bM=nil,math.huge for bN,bO in ipairs(a:GetPlayers())do local bP,bQ,bR=aK(bO)if bR and aQ(bO,bH)==bG and(not bF or aO(bO)==bF)then local bS=(bR.Position-bK.Position).Magnitude if bS=5 then aI(string.format('Baker nearby: @%s (%d studs)',bJ.Name,math.floor(bK)))ad,ae=ak(),bJ end else ae=nil end end local function bJ(bK,bL)local bM,bN={'None'},{}for bO,bQ in ipairs(a:GetPlayers())do local bR=Q==''or string.find(string.lower(bQ.Name),Q,1,true)or string.find(string.lower(bQ.DisplayName),Q,1,true)if bQ~=k and bR and(R=='All server players'or aQ(bQ,bK))then local bS=string.format('%s (@%s) [%s]',bQ.DisplayName,bQ.Name,aO(bQ)or'Player')table.insert(bM,bS)bN[bS]=bQ end end table.sort(bM,function(bO,bQ)if bO==bQ then return false elseif bO=='None'then return true elseif bQ=='None'then return false else return bO=bM.at then table.insert(bK,bM)end end while#bK>30 do table.remove(bK,1)end ao.visited=bK return bK end function ao.ticket()return{enabled=true,placeId=game.PlaceId,sourceJob=game.JobId,version='4.12',AutoRun=m.AutoRun,AutoHop=m.AutoHop,QueueMode=m.QueueMode,AntiAFK=m.AntiAFK,RunInBackground=m.RunInBackground,LowGraphics=m.LowGraphics,Disable3DRendering=m.Disable3DRendering,JoinEmpty=m.JoinEmpty,HideDistance=m.HideDistance,visited=ao. history(),attempts=ao.attempts,sessionStarted=ao.sessionStarted or os.time()}end function ao.arm()local bK=ar()if not bK then return false,[[Auto-resume unavailable: executor has no teleport queue hook]]end if not ao.armed then local bL=aq('readfile')if not bL then return false,'Auto-resume needs executor readfile support'end local bM for bN,bO in ipairs({'BakeTheBabyAdmin.luau','PlayerTools_BakeTheBaby.luau','PlayerTools_v2.luau'})do local bQ,bR=pcall(bL,bO)if bQ and type(bR)=='string'and#bR< 2000000 and bR:sub(1,80):find('local SCRIPT_ID = "'..SCRIPT_ID..'"',1,true)and bR:find('\nlocal storage = type(getgenv)',1,true)then bM=bR ao.sourcePath=bO break end end if not bM then return false,[[Auto-resume needs the v4.12 script in the executor workspace]]end local bN=bM:match([[(local function createHandoffStore%(storage%) .-) local function createPanel%(Rayfield, storage%)]])if not bN then return false,'Local script is missing its JSON handoff reader'end local bO=( [[local SUPPORTED_PLACE_ID = %d if game.PlaceId ~= SUPPORTED_PLACE_ID then return end ]]):format(SUPPORTED_PLACE_ID)..bN.. [[local env = type(getgenv) == "function" and getgenv() or _G if env.BTB412LoadedJob == game.JobId then return end local deadline = os.clock() + 60 while (not game:IsLoaded() or not game:GetService("Players").LocalPlayer) and os.clock() < deadline do task.wait(0.25) end if not game:IsLoaded() or not game:GetService("Players").LocalPlayer then warn("[Bake the Baby] Resume timed out waiting for the game"); return end local handoff = createHandoffStore(env) if not handoff.pending(handoff.read()) then return end env.BTB412LoadedJob = game.JobId local function runPanel() ]] ..bM..[[end for attempt = 1, 3 do local started, problem = pcall(runPanel) if started then return end warn("[Bake the Baby] Resume startup failed: " .. tostring(problem):sub(1, 160)) task.wait(attempt * 2) end env.BTB412LoadedJob = nil ]]local bQ,bR=pcall(bK,bO)if not bQ or bR==false then return false,'Executor rejected the auto-resume hook'end ao.armed=true end pcall(function()i:SetTeleportSetting('BTB412_AutoResume',ao.ticket())end)return true end function ao.serverPage(bK) local bL='https://games.roblox.com/v1/games/'..game.PlaceId..[[/servers/Public?sortOrder=Desc&excludeFullGames=true&limit=100]]if bK then bL..='&cursor='..j:UrlEncode(bK)end local bM=aq('request')or aq('http_request')local bN if bM then local bO=bM({Url=bL,Method='GET',Timeout=15})if type(bO)~='table'then error('Invalid server-list HTTP response')end local bQ=tonumber(bO.StatusCode or bO.Status)if bQ==429 then error('Server list rate limited (429)')end if not bQ or bQ<200 or bQ>=300 then error( 'Server list HTTP '..tostring(bQ))end bN=bO.Body else bN=game:HttpGet(bL)end if type(bN)~='string'or#bN>2000000 then error('Invalid server-list body')end local bO=j:JSONDecode(bN)if type(bO)~='table'or type(bO.data)~='table'then error('Invalid server-list JSON')end return bO end function ao.beginSearch()ao.generation+=1 local bK=ao.generation ao.searching,ao.workStarted=true,ak()ao.status='Finding a server with 30+ players and an open slot'ao.thread=task.spawn(function()local bL,bM=pcall( function()local bL,bM,bN,bO=nil,nil,{},{}bN[game.JobId]=true for bQ,bR in ipairs(ao.history())do bN[bR.id]=true end for bQ=1,3 do local bR=ao.serverPage(bL)if not n or bK~=ao.generation or not m.AutoRun or not m.AutoHop then return end for bS,bT in ipairs(bR.data)do if type(bT)=='table'then local bU,bV,bW=bT.id,tonumber(bT.playing),tonumber(bT.maxPlayers)if type(bU)=='string'and#bU>0 and#bU<=128 and bU:match('^[%w%-]+$')and not bN[bU]and bV and bW and bV>=30 and bVbM.playing or(bV==bM.playing and bX2000 or bO[bL]then break end bO[bL]=true end if not n or bK~=ao.generation or not m.AutoRun or not m.AutoHop then return end ao.searching=false if#a:GetPlayers()>=30 then ao.status='Population recovered; staying in this server'ao.nextCheck=ak()+10 return end if not bM then ao.status=[[No unvisited server with 30+ players and space; checking again in 60s]]ao.nextCheck=ak()+60 return end table.insert(ao.visited,{id=bM.id,at=os.time()})ao.attempts+=1 local bQ,bR=ao.arm()if not bQ then local bS=ao.visited[#ao.visited]if bS and bS.id==bM.id then table.remove(ao.visited)end ao.attempts-=1 ao.fail(bR,60)return end if not ap.mark(ao.ticket(),bM.id)then ao.fail(ap.status,60)return end if not n or bK~=ao.generation or not m.AutoRun or not m.AutoHop then ap.cancel( 'cancelled_before_teleport')return end a_(true)an.stopHiding(true)an.leaveQueue(true)ao.pending={id=bM.id,started=ak()}ao.status='Hopping to '..bM.playing..'/'..bM.capacity..' players | auto-resume armed'i:TeleportToPlaceInstance(game.PlaceId,bM.id,k)end)if bK==ao.generation then ao.searching=false if not bL then local bN=tostring(bM)ao.fail(bN,bN:find('429',1,true)and 60 or nil)end end end)end function ao.tick()if not m.AutoRun or not m.AutoHop then return end if ao.pending then if ak()-ao. pending.started>=25 then ao.fail('Teleport was not confirmed')end return end if ao.searching then if ak()-ao.workStarted>=25 then ao.fail('Server search timed out')end return end if ak()=30 then ao.lowSince,ao.failures=nil,0 ao.status=bK..' players | staying (minimum 30)'return end ao.lowSince=ao.lowSince or ak()if ak()-ao.started<20 or ak()-ao.lowSince<20 then ao.status=bK.. ' players | allowing 20s for population to settle'return end if not ar()or not ap.available()then ao.status=[[Auto-hop unavailable: executor needs queue_on_teleport, readfile and writefile]]ao.nextCheck=ak()+60 return end ao.beginSearch()end aw(i.TeleportInitFailed,function(bK,bL,bM,bN,bO)if bK~=k or bN~=game.PlaceId or not ao.pending then return end if bO and bO.ServerInstanceId~=''and bO.ServerInstanceId~=ao.pending.id then return end ao.fail('Teleport failed: '..tostring(bM))end)if k. OnTeleport then aw(k.OnTeleport,function(bK)if bK==Enum.TeleportState.Started and ao.pending and m.AutoRun and m.AutoHop then local bL,bM=ao.arm()if not bL then ao.status=bM end end end)end if k.Idled then aw(k.Idled,function()if not n or not m.AntiAFK or c:GetFocusedTextBox()or ak()<(ao.nextIdleInput or 0)then return end ao.nextIdleInput=ak()+60 local bK=pcall(function()local bK=game:GetService('VirtualUser')bK:CaptureController()bK:ClickButton2(Vector2.new(0,0))end)ao.idleStatus=bK and 'Idle input sent'or'Idle input unsupported by this runtime'A.idleStatus=ao.idleStatus end)end local function bK()local bL=aM()local bM={'Bake the Baby Admin Panel v4.12','Place: '..tostring(game.PlaceId),'Match: '..(bL and bL.id or'none')..' | Role: '..aP(k),'Role mode: '..P..' | Character.IsBaby: '..tostring(k.Character and k.Character:GetAttribute('IsBaby'))..' | Player.IsBaby (not used): '..tostring(k:GetAttribute('IsBaby')),'Movement: speed '..tostring(m.Speed)..' / '..m.WalkSpeed.. ' | jump '..tostring(m.Jump)..' / '..m.JumpPower,'Other prompt inputs sent: '..aj.prompts,'Carries: '..tostring(k.Character and k.Character:GetAttribute('Carries')),'Map: '..(bL and bL.world and bL.world:GetFullName()or'not replicated'),'Action: '..aa..' | Focused: '..tostring(o),'Automation: '..tostring(m.AutoRun)..' | '..an.status,'JSON handoff: '..ap.path..' | '..ap.status,'Server: '..#a:GetPlayers()..' players | '..ao.status,'Server-hop attempts: '..ao.attempts..' | resume hook: '..tostring( ao.armed)..' | source: '..tostring(ao.sourcePath or'not loaded')..' | session seconds: '..math.max(0,os.time()-ao.sessionStarted),'Keep-alive: '..tostring(ao.idleStatus or'Waiting for idle event'),'Background: '..tostring(m.RunInBackground)..' | Anti-AFK: '..tostring(m.AntiAFK)..' | Low graphics: '..tostring(m.LowGraphics),'Rendering: '..A.renderStatus,[[Timing: catch input 0.1s when ready | chase 0.02s | between babies 0.5s; frame/hold/ack limited]],'Input: '..(type(fireproximityprompt)== 'function'and'fireproximityprompt'or'InputHoldBegin / InputHoldEnd'),string.format([[Confirmed grabs: %d | deposits/carry clears: %d | rescues: %d | timeouts/errors: %d]],aj.grabs,aj.deposits,aj.rescues,aj.failedInputs)}an.scanQueues()an.scanOvens(bL)for bN,bO in ipairs(an.queues)do local bQ,bR=an.queuePad(bO)table.insert(bM,string.format('[queue] %s %d/%d%s | %s',bO.object.Name,bO.count,bO.capacity,bO.mine and' (you joined)'or'',table.concat(bO.members,', ')))table.insert(bM,' Free pad: '..(bQ and(bR..' | '..bQ:GetFullName())or'not available / not loaded'))end for bN,bO in ipairs(an.ovens)do local bQ=an.sitePrompt(bO,bL)local bR=an.ovenFront(bO,bQ)local bS=an.siteOccupied(bO,bL)local bT=an.ovenOccupants[bO.object]table.insert(bM,'[oven target] '..bO.object:GetFullName()..' | '..(bS and'occupied'or'available')..(bT and(' | confirmed occupant=@'..bT.player.Name)or'')..' | front='..(bR and bR.reason or'unresolved')..' | '..(bQ and('prompt='..bQ:GetFullName())or 'no deposit prompt; approach and verify trap state'))end local bN={}for bO in pairs(s)do local bQ=aZ(bO,bL)if bQ or(bL and bL.world and bO:IsDescendantOf(bL.world))then table.insert(bN,string.format([[[%s] %s | action=%s | object=%s | title=%s | type=%s | enabled=%s | range=%.1f | blocked=%s | disabled=%s]],bQ or'unknown',bO:GetFullName(),bO.ActionText,bO.ObjectText,tostring(bO:GetAttribute('Title')),tostring(bO:GetAttribute('Type')),tostring(bO.Enabled),bO.MaxActivationDistance,tostring(bO: GetAttribute('Obstructed')),tostring(bO:GetAttribute('Disabled'))))end end table.sort(bN)for bO=1,math.min(#bN,60)do table.insert(bM,bN[bO])end if#bN==0 then table.insert(bM,'No match interaction prompts are currently visible.')end return table.concat(bM,'\n')end am.Diagnostics=bK local bL=Rayfield:CreateWindow({Name='Bake the Baby Admin Panel',LoadingTitle='Bake the Baby',LoadingSubtitle='PlayerTools v4.12',Icon=0,ShowText='Baby Admin',Theme='AmberGlow',ToggleUIKeybind=Enum.KeyCode.RightShift, DisableRayfieldPrompts=true,ConfigurationSaving={Enabled=true,FolderName='BakeTheBabyAdmin',FileName='PlayerTools_v4_1'},Discord={Enabled=false},KeySystem=false})local bM=bL:CreateTab('Babies','baby')local bN=bL:CreateTab('Bakers','flame')local bO=bL:CreateTab('Misc','settings')local bQ=bL:CreateTab('Automation','repeat')local function bR(bS,bT,bU)Z=true for bV,bW in ipairs(Y[bS]or{})do if bW~=bU then bW:Set(bT)end end Z=false end local function bS(bT,bU)if not Y[bT]then Y[bT]={}end table. insert(Y[bT],bU)x[bT]=x[bT]or bU return bU end local function bT(bU,bV,bW)if not n or Z then return end if bU=='UseSavedSpot'and bV then local bX=aM()if not E or E.character~=k.Character or E.gameId~=(bX and bX.id)then bV,bW=false,nil aI('Save a return position first')end end local bX=m[bU]~=bV m[bU]=bV==true bR(bU,m[bU],bW)if bU=='AutoRun'and bX then a_(true)if not bV then an.stopHiding(true)an.leaveQueue(true)ao.cancel()ao.status='Stopped'end if bV then ao.lowSince,ao.nextCheck=nil,0 end an. status=bV and'Starting; detecting lobby or current round'or'Stopped'an.nextScan,an.nextQueueCheck,af=0,0,ak()+0.5 end if bU=='AutoHop'and bX then ao.cancel()ao.nextCheck=0 ao.status=bV and'Checking server population'or'Server hopping off'end if bU=='JoinEmpty'and bX then an.nextQueueCheck=0 end if bU=='RunInBackground'and not o and not aD()then a_(true)end if bU=='LowGraphics'then aF()end if bU=='Disable3DRendering'and not aG(m.Disable3DRendering)then m.Disable3DRendering=A.renderDisabled bR(bU, m.Disable3DRendering,nil)aI(A.renderStatus)end local bY=B and((bU=='AutoGrab'and not bV and B.kind=='grab')or(bU=='AutoOven'and not bV and B.kind=='oven')or(bU=='AutoRescue'and not bV and B.kind=='rescue')or((bU=='AutoPrompts'or bU=='OnlyEPrompts')and B.kind=='prompt'))if bX and bY then a_(true)af=ak()+0.25 end if bU=='AutoRescue'and not bV then X=nil end if bU=='Fly'and not bV then a0()end a5()be(aM())bz(aM())bD()bA()end local function bU(bV,bW,bX)local bY bY=bV:CreateToggle({Name=bX, CurrentValue=m[bW],Flag=not x[bW]and bW~='UseSavedSpot'and bW~='AutoRun'and('BTB3_'..bW)or nil,Ext=x[bW]~=nil,Callback=function(bZ)bT(bW,bZ,bY)end})return bS(bW,bY)end local function bV(bW,bX,bY,bZ,b_,b0,b1)local b2 b2=bW:CreateSlider({Name=bY,Range={bZ,b_},Increment=b0,Suffix=b1,CurrentValue=m[bX],Flag=not x[bX]and('BTB3_'..bX)or nil,Ext=x[bX]~=nil,Callback=function(b3)if not n or Z or type(b3)~='number'or b3~=b3 or math.abs(b3)==math.huge then return end m[bX]=math.clamp(b3,bZ,b_)bR(bX,m[bX], b2)if bX=='WalkSpeed'and T then T:Set(tostring(m.WalkSpeed))end a5()be(aM())bD()bA()end})return bS(bX,b2)end local function bW(bX,bY,bZ)bX:CreateButton({Name=bY,Callback=function()if not n then return end local b_,b0=xpcall(bZ,debug.traceback)if not b_ then warn('[Bake the Baby] '..tostring(b0))aI('Action failed; details are in the console')end end})end local function bX(bY,bZ)if x[bY]then x[bY]:Set(bZ)else bT(bY,bZ)end end local function bY()local bZ=B local b_=an.hide~=nil or an.joining~=nil bX('Disable3DRendering',false)a_(true)if not m.AutoRun then ao.cancel()end bX('AutoRun',false)bX('AutoGrab',false)bX('AutoOven',false)bX('AutoRescue',false)bX('AutoPrompts',false)X=nil local b0=aM()if not bZ and not b_ and W and W.character==k.Character and W.gameId==(b0 and b0.id)then a7(W.cframe)end aH('Stopped and returned when possible',3)end local function bZ()local b_,b0,b1=aK(k)if not b1 then aI('Wait for your character to spawn')return end local b2=aM()E={character=b_,gameId=b2 and b2.id ,cframe=b1.CFrame}bX('UseSavedSpot',true)aI('Return position saved')end local function b_()local b0=aM()if not E or E.character~=k.Character or E.gameId~=(b0 and b0.id)then aI('Save a return position in this life first')return end a_(true)af=ak()+0.6 local b1,b2=a7(E.cframe)aI(b1 and'Returned to saved position'or b2)end local function b0(b1)local b2=tonumber(b1)if not b2 or b2~=b2 or math.abs(b2)==math.huge then aI('Enter a speed from 1 to 250')return end x.WalkSpeed:Set(math.clamp(math.floor(b2 +0.5),1,250))bX('Speed',true)if T then T:Set(tostring(m.WalkSpeed))end end local b1={{id='Catch',name='Catch and return',key='O',action=true,run=function()bw('grab')end},{id='Rescue',name='Save and return',key='R',action=true,run=function()bw('rescue')end},{id='Oven',name='Oven and return',key='L',action=true,run=function()bw('oven')end},{id='Stop',name='Stop and return',key='H',action=true,run=bY}}for b2,b3 in ipairs({{'ESP','K'},{'InfiniteJump','J'},{'Noclip','N'},{'AutoPrompts','P'},{ 'InstantPrompts','I'},{'Speed','F'},{'Fly','G'}})do local b4=b3[1]table.insert(b1,{id=b4,name='Toggle '..b4,key=b3[2],run=function()bX(b4,not m[b4])end})end aw(c.InputBegan,function(b2,b3)if not n or c:GetFocusedTextBox()then return end for b4,b5 in ipairs(b1)do if b2.KeyCode==Enum.KeyCode[b5.key]then if b3 and not b5.action then return end if m.PauseUnfocused and not o and not b5.action then return end if b5.action then o=true end local b6,b7=xpcall(b5.run,debug.traceback)if not b6 then warn( '[Bake the Baby] '..tostring(b7))aI('Action failed; check diagnostics')end break end end end)M=bM:CreateLabel('Your role: waiting')bW(bM,'Save closest baby [R]',function()bw('rescue')end)bU(bM,'AutoRescue','Auto save trapped babies')bW(bM,'Save all trapped babies once',function()if aO(k)~='Baby'then aI('Use rescue while playing as a baby')return end if B then aI('Finish the current action first, or press H')return end local b2=aM()local b3={}for b4,b5 in ipairs(a:GetPlayers())do local b6=aK(b5) if b6 and aO(b5)=='Baby'and aQ(b5,b2)=='ally'and b6:GetAttribute('IsTrapped')then b3[b5]=true end end if not next(b3)then aI('No trapped teammates found')return end X=b3 aH('Saving trapped teammates one at a time...',2)end)bM:CreateSection('Survival')bU(bM,'Noclip','Noclip [N]')bU(bM,'InfiniteJump','Infinite jump [J]')bU(bM,'BakerAlert','Warn when a baker is near')bW(bM,'Stop and return [H]',bY)U=bM:CreateLabel('Rescue teleports to the oven, saves, then returns.')N=bN:CreateLabel( 'Your role: waiting')bW(bN,'Catch closest baby [O]',function()bw('grab')end)bU(bN,'AutoOven','Auto put held baby in oven')bU(bN,'AutoGrab','Auto catch babies')bW(bN,'Put held baby in oven [L]',function()bw('oven')end)K=bN:CreateLabel('Holding: no baby')O=bN:CreateLabel('Detected interaction prompts: waiting')bW(bN,'Rescan ovens',function()for b2,b3 in ipairs(f:GetDescendants())do ba(b3)end bb()local b2=aM()an.scanOvens(b2)bJ(b2,true)local b3=0 for b4 in pairs(s)do if aZ(b4,b2)=='oven'then b3+=1 end end aI(#an.ovens>0 and('Found '..#an.ovens..' ovens/traps and '..b3..' deposit prompts')or[[No oven targets loaded in this match. Copy detection report for details.]])end)bW(bN,'Copy detection report',function()if type(setclipboard)=='function'then setclipboard(bK())aI('Detection report copied')else print(bK())aI('Detection report printed to console')end end)bN:CreateSection('Tools')bU(bN,'Noclip','Noclip [N]')bU(bN,'OvenESP','Show ovens')bW(bN,'Stop and return [H]',bY)V=bN:CreateLabel( 'O follows one baby until caught, then returns. H cancels.')bQ:CreateSection('Round automation')bU(bQ,'AutoRun','Run automation')an.modeControl=bQ:CreateDropdown({Name='Game size',Options={'Any populated','1v1','2v2','3v3','4v4','5v5'},CurrentOption={m.QueueMode},MultipleOptions=false,Flag='BTB42_QueueMode',Callback=function(b2)local b3=b2[1]if b3~='Any populated'and not table.find({'1v1','2v2','3v3','4v4','5v5'},b3)then return end if m.QueueMode~=b3 then an.leaveQueue(true)end m.QueueMode,an. nextScan,an.nextQueueCheck=b3,0,0 end})bU(bQ,'JoinEmpty','Allow joining an empty queue')bV(bQ,'HideDistance','Baby distance from all players',400,1500,50,'studs')an.label=bQ:CreateLabel('Stopped')bU(bQ,'AutoHop','Auto hop below 30 players + resume')ao.label=bQ:CreateLabel('Server hopping waits for Run automation')bQ:CreateLabel([[Lobby: check every 10s and join the queue needing the fewest players. Full queues wait for the round.]])bQ:CreateLabel( [[Baby: hide outside map and hover. Baker: catch, oven, repeat.]])bQ:CreateLabel([[Catch: 0.1s attempts / 0.02s follow. Next baby: 0.5s after completion.]])bW(bQ,'Stop automation and return [H]',bY)bQ:CreateSection('Background and performance')bU(bQ,'RunInBackground','Keep automation running when minimized')bU(bQ,'AntiAFK','Anti-AFK (also while automation is stopped)')bU(bQ,'LowGraphics','Low graphics (fewer effects and shadows)')bU(bQ,'Disable3DRendering','Disable 3D rendering')bQ:CreateLabel( [[3D off: automation keeps running. Turn off this toggle or press H to restore the view.]])A.label=bQ:CreateLabel('Background ready | Anti-AFK waits for idle')bQ:CreateLabel([[Keep Roblox open and your Mac awake. Low graphics restores on disable or unload.]])bQ:CreateSection('Who is waiting to play')for b2=1,5 do an.queueLabels[b2]=bQ:CreateLabel(b2..'v'..b2..': loading')end bW(bQ,'Refresh queues',an.scanQueues)bW(bQ,'Copy automation report',function()if type(setclipboard)=='function'then setclipboard(bK())aI('Automation report copied')else print(bK())aI('Automation report printed to console')end end)bO:CreateSection('Movement')bU(bO,'Speed','Speed [F]')bV(bO,'WalkSpeed','Walk speed',1,250,1,'studs/s')bU(bO,'Jump','Higher jump')bV(bO,'JumpPower','Jump power',25,250,5,'power')bU(bO,'Fly','Fly [G]')bV(bO,'FlySpeed','Flight speed',10,200,5,'studs/s')bU(bO,'ESP','Opponent ESP [K]')bU(bO,'Fullbright','Fullbright')bO:CreateSection('Return spot')bW(bO,'Save current position',bZ)bU(bO, 'UseSavedSpot','Return to saved spot after actions')bW(bO,'Return to saved position',b_)bO:CreateSection('Panel')L=bO:CreateLabel('Match: waiting')J=bO:CreateLabel('Ready')local b2=false bW(bO,'More tools and settings',function()if b2 then aI('Extra tools are below this button')return end b2=true bO:CreateSection('Extra speed tools')T=bO:CreateInput({Name='Type walk speed (1-250)',CurrentValue=tostring(m.WalkSpeed),PlaceholderText='32',RemoveTextAfterFocusLost=false,Ext=true,Callback=function(b3 )if n and tostring(m.WalkSpeed)~=b3 then b0(b3)end end})bW(bO,'Speed -4',function()b0(m.WalkSpeed-4)end)bW(bO,'Speed +4',function()b0(m.WalkSpeed+4)end)for b3,b4 in ipairs({16,32,64,100})do local b5=b4 bW(bO,'Speed preset: '..b5,function()b0(b5)end)end bW(bO,'Restore game speed and jump',function()bX('Speed',false)bX('Jump',false)bX('InfiniteJump',false)end)bO:CreateSection('Pickup and oven options')bU(bO,'ExpandPickup','Pickup hitbox expander')bV(bO,'PickupRadius','Pickup radius',4,75,1,'studs' )bU(bO,'ShowPickupRange','Show pickup area')bU(bO,'TravelToOven','Auto oven can teleport')bU(bO,'ReturnAfterOven','Return after automatic oven delivery')I=bO:CreateDropdown({Name='Oven prompt',Options={'Automatic detection'},CurrentOption={'Automatic detection'},MultipleOptions=false,Callback=function(b3)local b4=am.OvenOptions and am.OvenOptions[b3[1] ]if b4~=G then a_(true)end G=b4 end})bW(bO,'Refresh oven and player lists',function()bJ(aM(),true)aI('Lists refreshed')end)bO:CreateSection( 'View and interaction')bV(bO,'AlertRadius','Baker alert distance',10,120,5,'studs')bV(bO,'ESPDistance','ESP distance',100,5000,100,'studs')bO:CreateColorPicker({Name='Opponent ESP color',Color=m.ESPColor,Flag='BTB3_ESPColor',Callback=function(b3)if n then m.ESPColor=b3 bz(aM())end end})bU(bO,'InstantPrompts','Instant prompts [I]')bU(bO,'AutoPrompts','Auto other proximity prompts [P]')bU(bO,'OnlyEPrompts','Auto prompts: E key only')bU(bO,'RepeatPrompts','Repeat prompts while in range')bU(bO, 'CustomFOV','Custom camera FOV')bV(bO,'FOV','Field of view',50,120,1,'degrees')bU(bO,'PauseUnfocused','Pause manual movement keys when unfocused')bO:CreateSection('Player teleport')bO:CreateInput({Name='Search players',PlaceholderText='Username or display name',RemoveTextAfterFocusLost=false,Callback=function(b3)if not n then return end Q=string.lower(tostring(b3)):match('^%s*(.-)%s*$')bJ(aM(),true)end})bO:CreateDropdown({Name='Player list scope',Options={'All server players', 'Current match only'},CurrentOption={'All server players'},MultipleOptions=false,Callback=function(b3)R=b3[1]bJ(aM(),true)end})H=bO:CreateDropdown({Name='Selected player',Options={'None'},CurrentOption={'None'},MultipleOptions=false,Callback=function(b3)F=am.PlayerOptions and am.PlayerOptions[b3[1] ]end})bW(bO,'Teleport beside selected player',function()bF(F)end)bW(bO,'Refresh players',function()bJ(aM(),true)end)bO:CreateSection('Shortcuts')for b3,b4 in ipairs(b1)do local b5=b4 bO:CreateKeybind( {Name=b5.name..' key',CurrentKeybind=b5.key,HoldToInteract=false,CallOnChange=true,Flag='BTB4_'..b5.id..'Key',Callback=function(b6)if type(b6)~='string'then return end local b7,b8=pcall(function()return Enum.KeyCode[b6]end)if b7 and b8~=Enum.KeyCode.Unknown then b5.key=b6 end end})end bO:CreateSection('Diagnostics')S=bO:CreateDropdown({Name='Your role',Options={'Automatic','Baby','Baker / Adult'},CurrentOption={'Automatic'},MultipleOptions=false,Callback=function(b3)local b4=b3[1]P=b4=='Baby'and 'Baby'or b4=='Baker / Adult'and'Baker'or'Automatic'a_(true)X=nil aB(y.prompt)be(aM())bz(aM())bA()end})bW(bO,'Print interaction diagnostics',function()print(bK())aI('Details printed to the console')end)bW(bO,'Copy interaction diagnostics',function()if type(setclipboard)=='function'then setclipboard(bK())aI('Diagnostics copied')else print(bK())aI('Diagnostics printed to console')end end)bJ(aM(),true)pcall(function()Rayfield:LoadConfiguration()end)aI('Extra tools added below')end)bW(bO, 'Turn off all features',function()bY()for b3,b4 in pairs(m)do if type(b4)=='boolean'and b3~='PauseUnfocused'then bX(b3,false)end end aI('Features off; original values restored')end)bW(bO,'Unload panel and restore everything',a3)bO:CreateLabel('O: catch | R: save | L: oven | H: stop and return')bO:CreateLabel('Right Shift: UI | F: speed | J: jump | N: noclip | G: fly')local function b3(b4)if not n then return end local b5=aO(k)or'waiting'local b6='Your role: '..aP(k)..' | '..(P=='Automatic'and 'auto detected'or'manual selection')L:Set('Match: '..(b4 and b4.id or'lobby')..' | '..b6)M:Set(b6)N:Set(b6)local b7=aR(k.Character)local b8=b7 and bk(b4)K:Set(b7 and('Holding a baby: YES'..(b8 and(' (@'..b8.Name..')')or''))or'Holding a baby: no')local b9={grab=0,oven=0,rescue=0}for ca in pairs(s)do local cb=aZ(ca,b4)if cb then b9[cb]+=1 end end if an.ovenWorld~=(b4 and b4.world)or ak()>=(an.nextOvenScan or 0)then an.scanOvens(b4)end if O then O:Set(string.format( [[Detected: %d pickup / %d ovens or traps / %d deposit / %d rescue prompts]],b9.grab,#an.ovens,b9.oven,b9.rescue))end if an.label then an.label:Set(m.AutoRun and(B and('Role: '..aP(k)..' | '..aa)or an.status)or'Stopped')end if ao.label then ao.label:Set(ao.status)end if A.label then local ca=o and'Window focused'or aD()and'Running in background'or'Background paused'local cb=not m.AntiAFK and'Anti-AFK off'or A.idleStatus A.label:Set(ca..' | '..cb..(m.LowGraphics and' | Low graphics on'or'').. ' | '..A.renderStatus)end if ak()>=ab and not B then if not b4 or not aN(k,b4)then aa='No active match - movement and other prompts available'elseif b5=='Baker'and b7 then aa=m.AutoOven and(b9.oven>0 and'Baby held \u{2014} finding an available oven'or'Baby held \u{2014} waiting for an oven prompt')or'Baby held \u{2014} auto oven is off'elseif b5=='Baker'and m.AutoGrab then aa='Auto catch: waiting for an available enemy baby'elseif b5=='Baby'and m.AutoRescue then aa= 'Auto save: waiting for a trapped teammate'else aa='Ready'end end if aa~=_ then J:Set(aa)U:Set(aa)V:Set(aa)_=aa end end local b4={}local function b5(b6,b7)local b8=b4[b6]if b8 and ak()=0.1 then b6=0 b5('server hopping',ao.tick)b5('movement',a5)b5('automation',function()be(ca)bv(ca)end)bA()elseif B and B.chase and ak()>=B.nextMove then b5('automation',function()bv(ca)end)end if b7>=(o and not A.renderDisabled and 0.2 or 1)then b7=0 b5('ESP',function()bz(ca)end)end if b8>=0.75 then b8=0 b5('queue detection',an. scanQueues)b5('oven detection',bb)b5('view',bD)b5('status',function()b3(ca)bJ(ca)bG()end)end end)pcall(function()Rayfield:LoadConfiguration()end)local b9=ao.generation local ca,cb=ap.read()local cc=ap.pending(ca)and ca.resume or nil if not ca then ap.normal('startup: '..tostring(cb),nil)elseif not cc then ap.status=ca.status=='normal'and'normal'or'Pending JSON does not match this arrival'end local cd=cc and n and ao.generation==b9 if cd and ap.consume(ca)and n and ao.generation==b9 then if type( cc.visited)=='table'then ao.visited=cc.visited ao.history()end ao.attempts=type(cc.attempts)=='number'and math.max(0,cc.attempts)or 0 ao.sessionStarted=type(cc.sessionStarted)=='number'and cc.sessionStarted or os.time()if cc.QueueMode=='Any populated'or table.find({'1v1','2v2','3v3','4v4','5v5'},cc.QueueMode)then an.modeControl:Set({cc.QueueMode})end bX('JoinEmpty',cc.JoinEmpty==true)if type(cc.HideDistance)=='number'then x.HideDistance:Set(math.clamp(cc.HideDistance,400,1500))end for ce,cf in ipairs({'AntiAFK','RunInBackground','LowGraphics','Disable3DRendering'})do if type(cc[cf])=='boolean'then bX(cf,cc[cf])end end bX('AutoHop',cc.AutoHop==true)bX('AutoRun',cc.AutoRun==true)ao.status='Resumed after teleport; checking the new server'end bJ(aM(),true)be(aM())bz(aM())b3(aM())aI([[Ready - O: catch, R: save, L: oven. Each action returns you.]])return am end local storage = type(getgenv) == "function" and getgenv() or _G local a=storage.BakeTheBabyAdmin if type(a)=='table'and type(a.Shutdown)=='function'then pcall(a.Shutdown)end local b=game:GetService('Players').LocalPlayer local c=b and b:FindFirstChild('PlayerGui')if c then for d,e in ipairs({'PlayerTools','BakeTheBabyAdminRuntime'})do local f=c:FindFirstChild(e)local g=f and f:FindFirstChild('Shutdown')if g and g:IsA('BindableFunction')then pcall(function()g:Invoke()end)end end end assert(type(loadstring)=='function', [[Rayfield needs loadstring in a compatible client script runner.]])local d,e=pcall(function()local d=game:HttpGet('https://sirius.menu/rayfield')local e,f=loadstring(d)assert(e,f)return e()end)assert(d and type(e)=='table'and type(e.CreateWindow)=='function','Could not load Rayfield: '..tostring(e))local f,g=xpcall(function()return createPanel(e,storage)end,debug.traceback)if not f then local h=storage.BakeTheBabyAdmin if h then pcall(h.Shutdown)end error( 'Bake the Baby Admin Panel failed to start:\n'..tostring(g))end return g