local Players = game:GetService("Players") local Player = Players.LocalPlayer local FOLLOW_DISTANCE = 5 local TELEPORT_DISTANCE = 20 local STUCK_TIME = 3 local CHECK_INTERVAL = 0.5 local Colors = { Red = Color3.fromRGB(220, 35, 35), Green = Color3.fromRGB(25, 190, 75), Gray = Color3.fromRGB(115, 115, 115), Blue = Color3.fromRGB(35, 125, 230), Purple = Color3.fromRGB(145, 75, 220), White = Color3.fromRGB(255, 255, 255), SubText = Color3.fromRGB(145, 145, 145), Background = Color3.fromRGB(12, 12, 12), Stroke = Color3.fromRGB(55, 55, 55) } local Bot local OriginalCharacter local OriginalHumanoid local OriginalRoot local SavedSettings local BotDeathConnection local OriginalDeathConnection local CharacterAddedConnection local BotGenerated = false local Following = false local Controlling = false local Minimized = false local SessionActive = false local FollowToken = 0 local SessionToken = 0 local CleanupBot local function SetCamera(Humanoid) if not Humanoid or not Humanoid.Parent then return end local Camera = workspace.CurrentCamera if not Camera then return end Camera.CameraType = Enum.CameraType.Custom Camera.CameraSubject = Humanoid end Player.CharacterAdded:Connect(function(Character) task.spawn(function() local Humanoid = Character:WaitForChild("Humanoid", 10) if Humanoid and Player.Character == Character then SetCamera(Humanoid) end end) end) local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "LONELY_HUB" ScreenGui.ResetOnSpawn = false ScreenGui.Parent = Player:WaitForChild("PlayerGui") local Main = Instance.new("Frame") Main.Size = UDim2.new(0, 230, 0, 225) Main.Position = UDim2.new(0, 30, 0, 180) Main.BackgroundColor3 = Colors.Background Main.BorderSizePixel = 0 Main.Active = true Main.Draggable = true Main.Parent = ScreenGui Instance.new("UICorner", Main).CornerRadius = UDim.new(0, 8) local Stroke = Instance.new("UIStroke") Stroke.Color = Colors.Stroke Stroke.Thickness = 1 Stroke.Parent = Main local Title = Instance.new("TextLabel") Title.Size = UDim2.new(1, 0, 0, 36) Title.Position = UDim2.new(0, 0, 0, 5) Title.BackgroundTransparency = 1 Title.Text = "LONELY HUB" Title.TextColor3 = Colors.White Title.TextSize = 22 Title.Font = Enum.Font.GothamBlack Title.TextXAlignment = Enum.TextXAlignment.Center Title.TextYAlignment = Enum.TextYAlignment.Center Title.Parent = Main local Subtitle = Instance.new("TextLabel") Subtitle.Size = UDim2.new(1, 0, 0, 16) Subtitle.Position = UDim2.new(0, 0, 0, 48) Subtitle.BackgroundTransparency = 1 Subtitle.Text = "Property of Lonely" Subtitle.TextColor3 = Colors.SubText Subtitle.TextSize = 10 Subtitle.Font = Enum.Font.Gotham Subtitle.TextXAlignment = Enum.TextXAlignment.Center Subtitle.Parent = Main local MinButton = Instance.new("TextButton") MinButton.Size = UDim2.new(0, 25, 0, 25) MinButton.Position = UDim2.new(1, -30, 0, 5) MinButton.BackgroundTransparency = 1 MinButton.Text = "−" MinButton.TextColor3 = Colors.White MinButton.TextSize = 20 MinButton.Font = Enum.Font.GothamBold MinButton.Parent = Main local Scroll = Instance.new("ScrollingFrame") Scroll.Position = UDim2.new(0, 5, 0, 75) Scroll.Size = UDim2.new(1, -10, 1, -82) Scroll.BackgroundTransparency = 1 Scroll.BorderSizePixel = 0 Scroll.ScrollBarThickness = 3 Scroll.ScrollBarImageColor3 = Colors.Stroke Scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y Scroll.Parent = Main local Layout = Instance.new("UIListLayout") Layout.Padding = UDim.new(0, 8) Layout.HorizontalAlignment = Enum.HorizontalAlignment.Center Layout.SortOrder = Enum.SortOrder.LayoutOrder Layout.Parent = Scroll local function CreateButton(Name, Text, Order) local Button = Instance.new("TextButton") Button.Name = Name Button.Size = UDim2.new(1, -12, 0, 38) Button.BackgroundTransparency = 1 Button.BorderSizePixel = 0 Button.Text = Text Button.TextColor3 = Colors.Gray Button.TextSize = 12 Button.Font = Enum.Font.GothamBold Button.TextXAlignment = Enum.TextXAlignment.Center Button.LayoutOrder = Order Button.AutoButtonColor = false Button.Parent = Scroll return Button end local GenerateButton = CreateButton("GenerateButton", "GENERATE BOT: OFF", 1) local FollowButton = CreateButton("FollowButton", "COME TO ME: OFF", 2) local ControlButton = CreateButton("ControlButton", "CONTROL BOT: OFF", 3) local function UpdateButtons() GenerateButton.Text = BotGenerated and "GENERATE BOT: ON" or "GENERATE BOT: OFF" GenerateButton.TextColor3 = BotGenerated and Colors.Green or Colors.Red FollowButton.Text = Following and "COME TO ME: ON" or "COME TO ME: OFF" FollowButton.TextColor3 = Following and Colors.Blue or Colors.Gray ControlButton.Text = Controlling and "CONTROL BOT: ON" or "CONTROL BOT: OFF" ControlButton.TextColor3 = Controlling and Colors.Purple or Colors.Gray end local function RestoreOriginal() if not SavedSettings then return end if OriginalHumanoid and OriginalHumanoid.Parent and OriginalHumanoid.Health > 0 then OriginalHumanoid.WalkSpeed = SavedSettings.WalkSpeed OriginalHumanoid.JumpPower = SavedSettings.JumpPower OriginalHumanoid.JumpHeight = SavedSettings.JumpHeight OriginalHumanoid.AutoRotate = SavedSettings.AutoRotate end SavedSettings = nil end local function StopFollowing() Following = false FollowToken += 1 UpdateButtons() end CleanupBot = function() if not SessionActive and not Bot then return end Following = false FollowToken += 1 SessionActive = false SessionToken += 1 if OriginalDeathConnection then OriginalDeathConnection:Disconnect() OriginalDeathConnection = nil end if BotDeathConnection then BotDeathConnection:Disconnect() BotDeathConnection = nil end if CharacterAddedConnection then CharacterAddedConnection:Disconnect() CharacterAddedConnection = nil end if Player.Character == Bot and OriginalCharacter and OriginalCharacter.Parent and OriginalHumanoid and OriginalHumanoid.Health > 0 then Player.Character = OriginalCharacter SetCamera(OriginalHumanoid) end RestoreOriginal() if Bot then Bot:Destroy() Bot = nil end BotGenerated = false Following = false Controlling = false OriginalCharacter = nil OriginalHumanoid = nil OriginalRoot = nil SavedSettings = nil UpdateButtons() end local function WatchOriginalDeath(Humanoid, CurrentSession) if OriginalDeathConnection then OriginalDeathConnection:Disconnect() OriginalDeathConnection = nil end OriginalDeathConnection = Humanoid.Died:Connect(function() if not SessionActive then return end if SessionToken ~= CurrentSession then return end if OriginalHumanoid ~= Humanoid then return end task.defer(function() if not SessionActive then return end if SessionToken ~= CurrentSession then return end if OriginalHumanoid ~= Humanoid then return end CleanupBot() end) end) end local function GenerateBot() if BotGenerated or SessionActive then return end local Character = Player.Character if not Character then return end local Humanoid = Character:FindFirstChildOfClass("Humanoid") local Root = Character:FindFirstChild("HumanoidRootPart") if not Humanoid or not Root or Humanoid.Health <= 0 then return end OriginalCharacter = Character OriginalHumanoid = Humanoid OriginalRoot = Root SessionActive = true SessionToken += 1 local CurrentSession = SessionToken WatchOriginalDeath(Humanoid, CurrentSession) CharacterAddedConnection = Player.CharacterAdded:Connect(function(NewCharacter) if not SessionActive then return end if SessionToken ~= CurrentSession then return end if NewCharacter == Bot then return end if NewCharacter == OriginalCharacter then return end task.defer(function() if not SessionActive then return end if SessionToken ~= CurrentSession then return end if Player.Character ~= NewCharacter then return end CleanupBot() end) end) local PreviousArchivable = Character.Archivable Character.Archivable = true local Success, NewBot = pcall(function() return Character:Clone() end) Character.Archivable = PreviousArchivable if not Success or not NewBot or not SessionActive or SessionToken ~= CurrentSession or Player.Character ~= Character or Humanoid.Health <= 0 then if NewBot then NewBot:Destroy() end CleanupBot() return end Bot = NewBot Bot.Name = "BOT" local BotHumanoid = Bot:FindFirstChildOfClass("Humanoid") local BotRoot = Bot:FindFirstChild("HumanoidRootPart") if not BotHumanoid or not BotRoot then CleanupBot() return end Bot.Parent = workspace Bot:PivotTo(Character:GetPivot() * CFrame.new(0, 0, -5)) BotGenerated = true BotDeathConnection = BotHumanoid.Died:Connect(function() if not SessionActive then return end if SessionToken ~= CurrentSession then return end task.defer(function() if not SessionActive then return end if SessionToken ~= CurrentSession then return end CleanupBot() end) end) UpdateButtons() end local function StartFollowing() if not BotGenerated or not Bot or Controlling then return end if not OriginalHumanoid or OriginalHumanoid.Health <= 0 then return end Following = true FollowToken += 1 local CurrentToken = FollowToken local CurrentSession = SessionToken UpdateButtons() task.spawn(function() local LastPosition local StuckTimer = 0 while Following and CurrentToken == FollowToken and CurrentSession == SessionToken and SessionActive and Bot and Bot.Parent do if not OriginalCharacter or not OriginalCharacter.Parent then break end if not OriginalHumanoid or OriginalHumanoid.Health <= 0 then break end local BotHumanoid = Bot:FindFirstChildOfClass("Humanoid") local BotRoot = Bot:FindFirstChild("HumanoidRootPart") local PlayerRoot = OriginalCharacter:FindFirstChild("HumanoidRootPart") if not BotHumanoid or not BotRoot or not PlayerRoot then break end local TargetPosition = PlayerRoot.Position - PlayerRoot.CFrame.LookVector * FOLLOW_DISTANCE local Distance = (BotRoot.Position - TargetPosition).Magnitude if Distance >= TELEPORT_DISTANCE then Bot:PivotTo( PlayerRoot.CFrame * CFrame.new(0, 0, FOLLOW_DISTANCE) ) StuckTimer = 0 LastPosition = nil else if Distance > 2 then BotHumanoid:MoveTo(TargetPosition) end if LastPosition then local Movement = (BotRoot.Position - LastPosition).Magnitude if Movement < 0.5 and Distance > 4 then StuckTimer += CHECK_INTERVAL else StuckTimer = 0 end if StuckTimer >= STUCK_TIME then Bot:PivotTo( PlayerRoot.CFrame * CFrame.new(0, 0, FOLLOW_DISTANCE) ) StuckTimer = 0 end end LastPosition = BotRoot.Position end task.wait(CHECK_INTERVAL) end if CurrentToken == FollowToken and CurrentSession == SessionToken then Following = false UpdateButtons() end end) end local function ControlBot() if not BotGenerated or not Bot or Controlling then return end if not OriginalHumanoid or OriginalHumanoid.Health <= 0 then return end StopFollowing() SavedSettings = { WalkSpeed = OriginalHumanoid.WalkSpeed, JumpPower = OriginalHumanoid.JumpPower, JumpHeight = OriginalHumanoid.JumpHeight, AutoRotate = OriginalHumanoid.AutoRotate } OriginalHumanoid.WalkSpeed = 0 OriginalHumanoid.JumpPower = 0 OriginalHumanoid.JumpHeight = 0 OriginalHumanoid.AutoRotate = false local BotHumanoid = Bot:FindFirstChildOfClass("Humanoid") if not BotHumanoid or BotHumanoid.Health <= 0 then RestoreOriginal() return end Controlling = true Player.Character = Bot SetCamera(BotHumanoid) UpdateButtons() end local function ReturnControl() if not Controlling then return end if not OriginalCharacter or not OriginalCharacter.Parent or not OriginalHumanoid or OriginalHumanoid.Health <= 0 then CleanupBot() return end Controlling = false Player.Character = OriginalCharacter RestoreOriginal() SetCamera(OriginalHumanoid) UpdateButtons() end GenerateButton.MouseButton1Click:Connect(GenerateBot) FollowButton.MouseButton1Click:Connect(function() if not BotGenerated or Controlling then return end if Following then StopFollowing() else StartFollowing() end end) ControlButton.MouseButton1Click:Connect(function() if not BotGenerated then return end if Controlling then ReturnControl() else ControlBot() end end) MinButton.MouseButton1Click:Connect(function() Minimized = not Minimized if Minimized then Main.Size = UDim2.new(0, 230, 0, 38) Scroll.Visible = false Subtitle.Visible = false MinButton.Text = "+" else Main.Size = UDim2.new(0, 230, 0, 225) Scroll.Visible = true Subtitle.Visible = true MinButton.Text = "−" end end) UpdateButtons()