local P,U,Pl,V,R,RR,T=game:GetService("PathfindingService"),game:GetService("UserInputService"),game:GetService("Players"),game:GetService("VirtualUser"),game:GetService("ReplicatedStorage"),game:GetService("RobloxReplicatedStorage"),game:GetService("TextChatService") local p,sr,na,wa,aa,ca,ct,ac,ch=Pl.LocalPlayer,true,false,false,false,false,nil,nil,nil local c=p.Character or p.CharacterAdded:Wait() local h,r=c:WaitForChild("Humanoid"),c:WaitForChild("HumanoidRootPart") local ph={"Hello traveler!","Fine weather today.","Nice day for fishing, ain't it?","Do you need directions?","Just patrolling.","Hmm... must have been the wind.","Greetings!","Stay safe out there."} local sg=Instance.new("ScreenGui",p:WaitForChild("PlayerGui"))sg.Name="USB_NPCSim"sg.ResetOnSpawn=false -- USB MAIN BODY FRAME local mf=Instance.new("Frame",sg)mf.Size=UDim2.new(0,180,0,320)mf.Position=UDim2.new(0.05,0,0.4,0)mf.BackgroundColor3=Color3.fromRGB(9,38,25)mf.BorderSizePixel=0;mf.Active=true;mf.Draggable=true Instance.new("UICorner",mf).CornerRadius=UDim.new(0,4) local s=Instance.new("UIStroke",mf)s.Color=Color3.fromRGB(0,210,255)s.Thickness=2 -- FIXED: CENTERING MATH FOR THE METAL CONNECTOR PLUG local usbPlug=Instance.new("Frame",mf)usbPlug.Size=UDim2.new(0,50,0,25)usbPlug.Position=UDim2.new(0.5,0,0,0)usbPlug.AnchorPoint=Vector2.new(0.5,1)usbPlug.BackgroundColor3=Color3.fromRGB(180,185,190)usbPlug.BorderSizePixel=0 local ps=Instance.new("UIStroke",usbPlug)ps.Color=Color3.fromRGB(120,125,130)ps.Thickness=1 local pc=Instance.new("UICorner",usbPlug)pc.CornerRadius=UDim.new(0,4) -- FIXED: EXACT POSITIONING FOR INSIDE HOLES local hole1=Instance.new("Frame",usbPlug)hole1.Size=UDim2.new(0,8,0,6)hole1.Position=UDim2.new(0.25,0,0.4,0)hole1.AnchorPoint=Vector2.new(0.5,0.5)hole1.BackgroundColor3=Color3.fromRGB(50,50,50)hole1.BorderSizePixel=0 local hole2=Instance.new("Frame",usbPlug)hole2.Size=UDim2.new(0,8,0,6)hole2.Position=UDim2.new(0.75,0,0.4,0)hole2.AnchorPoint=Vector2.new(0.5,0.5)hole2.BackgroundColor3=Color3.fromRGB(50,50,50)hole2.BorderSizePixel=0 -- TITLE & RECTANGULAR TOP BUTTONS local tl=Instance.new("TextLabel",mf)tl.Size=UDim2.new(1,0,0,35)tl.Text="USB CORE"tl.TextColor3=Color3.fromRGB(0,220,255)tl.BackgroundTransparency=1;tl.Font=Enum.Font.SourceSansBold;tl.TextSize=16 local function cb(t,y) local b=Instance.new("TextButton",mf)b.Size=UDim2.new(0.9,0,0,38)b.Position=UDim2.new(0.05,0,0,y)b.BackgroundColor3=Color3.fromRGB(15,60,40)b.Text=t;b.TextColor3=Color3.fromRGB(180,240,255)b.Font=Enum.Font.SourceSansSemibold;b.TextSize=14;b.BorderSizePixel=0 local bs=Instance.new("UIStroke",b)bs.Color=Color3.fromRGB(0,140,180)bs.Thickness=1 return b end local bW,bM,bA,bC,bD=cb("NPC Patrol: OFF",40),cb("Wall Avoidance: OFF",85),cb("Anti-AFK: OFF",130),cb("NPC Chat: OFF",175),cb("Self Destruct Script",220) bD.BackgroundColor3=Color3.fromRGB(110,25,25)bD.TextColor3=Color3.fromRGB(255,220,220)bD:FindFirstChildOfClass("UIStroke").Color=Color3.fromRGB(180,40,40) local footer=Instance.new("TextLabel",mf)footer.Size=UDim2.new(1,0,0,25)footer.Position=UDim2.new(0,0,1,-30)footer.Text="NPC SIM v2.0"footer.TextColor3=Color3.fromRGB(0,170,200)footer.BackgroundTransparency=1;footer.Font=Enum.Font.SourceSansItalic;footer.TextSize=12 local function gRP()local oX,oZ=math.random(-65,65),math.random(-65,65)return Vector3.new(r.Position.X+oX,r.Position.Y,r.Position.Z+oZ)end local function iWB()local rp=RaycastParams.new()rp.FilterType=Enum.RaycastFilterType.Exclude;rp.FilterDescendantsInstances={c}local f=workspace:Raycast(r.Position,r.CFrame.LookVector*4.5,rp)return (f and f.Instance and f.Instance.CanCollide) and true or false end local function wTD(tP) if wa then local pth=P:CreatePath({AgentRadius=4.5,AgentHeight=5.5,AgentCanJump=false}) local s,e=pcall(function()pth:ComputeAsync(r.Position,tP)end) if s and pth.Status==Enum.PathStatus.Success then local w=pth:GetWaypoints() for i=2,#w do if not na or not sr then break end if iWB() then h:MoveTo(r.Position-(r.CFrame.LookVector*2))task.wait(0.2)break end h:MoveTo(w[i].Position)local cp,cn=false,nil;cn=h.MoveToFinished:Connect(function()cp=true end)local st=os.clock() while not cp and (os.clock()-st)<1.5 do if iWB() then break end task.wait() end;if cn then cn:Disconnect() end;if iWB() then break end end return end end h:MoveTo(tP)local cp,cn=false,nil;cn=h.MoveToFinished:Connect(function()cp=true end)local st=os.clock() while not cp and (os.clock()-st)<4 do if wa and iWB() then break end task.wait() end;if cn then cn:Disconnect() end end local function sL() if ct then task.cancel(ct) end;ct=task.spawn(function()while sr and na do h.WalkSpeed=12;h.JumpPower=0;wTD(gRP())if not na or not sr then break end task.wait(0.1)end end)end local function stL() if ct then task.cancel(ct)ct=nil end;h.WalkSpeed=16;h.JumpPower=50;h:MoveTo(r.Position)end local function sCM(m)local ic=T:FindFirstChild("ChatInputBarConfiguration")if ic and ic.TargetTextChannel then ic.TargetTextChannel:SendAsync(m)return end;local tc=T:FindFirstChild("TextChannels")local rg=tc and (tc:FindFirstChild("RBXGeneral") or tc:FindFirstChild("RBXInGameChat"))if rg then rg:SendAsync(m)return end;local le=R:FindFirstChild("DefaultChatSystemChatEvents") and R.DefaultChatSystemChatEvents:FindFirstChild("SayMessageRequest")if le then le:FireServer(m,"All")end end bW.MouseButton1Click:Connect(function()na=not na;bW.Text=na and "NPC Patrol: ON" or "NPC Patrol: OFF"bW.BackgroundColor3=na and Color3.fromRGB(0,200,115) or Color3.fromRGB(15,60,40)bW.TextColor3=na and Color3.fromRGB(9,38,25) or Color3.fromRGB(180,240,255)if na then sL()else stL()end end) bM.MouseButton1Click:Connect(function()wa=not wa;bM.Text=wa and "Wall Avoidance: ON" or "Wall Avoidance: OFF"bM.BackgroundColor3=wa and Color3.fromRGB(0,200,115) or Color3.fromRGB(15,60,40)bM.TextColor3=wa and Color3.fromRGB(9,38,25) or Color3.fromRGB(180,240,255)end) bA.MouseButton1Click:Connect(function()aa=not aa;bA.Text=aa and "Anti-AFK: ON" or "Anti-AFK: OFF"bA.BackgroundColor3=aa and Color3.fromRGB(0,200,115) or Color3.fromRGB(15,60,40)bA.TextColor3=aa and Color3.fromRGB(9,38,25) or Color3.fromRGB(180,240,255)if aa then ac=p.Idled:Connect(function()V:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)task.wait(1)V:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)end)else if ac then ac:Disconnect()ac=nil end end end) bC.MouseButton1Click:Connect(function()ca=not ca;bC.Text=ca and "NPC Chat: ON" or "NPC Chat: OFF"bC.BackgroundColor3=ca and Color3.fromRGB(0,200,115) or Color3.fromRGB(15,60,40)bC.TextColor3=ca and Color3.fromRGB(9,38,25) or Color3.fromRGB(180,240,255)if ca then if ch then task.cancel(ch)end;ch=task.spawn(function()while sr and ca do task.wait(math.random(15,25))if not ca or not sr then break end;sCM(ph[math.random(1,#ph)])end end)else if ch then task.cancel(ch)ch=nil end end end) bD.MouseButton1Click:Connect(function()sr,na,ca=false,false,false;stL()if ac then ac:Disconnect()end;if ch then task.cancel(ch)end;sg:Destroy()end) U.InputBegan:Connect(function(i,g)if not g and i.KeyCode==Enum.KeyCode.RightControl then mf.Visible=not mf.Visible end end)