-- // ------------------------------------------------------------ \\ -- // YOUNG STREET ONTARIO V13 โ€“ NO ANTI-AFK, FIXED LOOPING \\ -- // No fallback to nearest; re-scan on failure; no anti-AFK \\ -- // ------------------------------------------------------------ \\ local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local VirtualInput = game:GetService("VirtualInputManager") local UserInputService = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") local RootPart = Character:WaitForChild("HumanoidRootPart") -- // ========== GLOBALS ========== \\ local farmActive = false local farmCoroutine = nil local charAddedConn = nil local gui = nil local statusLabel = nil local subStatusLabel = nil local toggleButton = nil -- // ========== CONFIG ========== \\ local Config = { PromptHoldTime = 0.5, PickupCooldown = 60, DeliveryCooldown = 60, RetryDelay = 1.5, MaxRetries = 3, -- overall cycle retries DeliveryMaxAttempts = 3, -- delivery prompt retries per cycle ToolName = "Food box", ActiveScanTimeout = 5, TeleportStyle = "Instant", FlyHeightOffset = 3, } -- // ========== FOLDERS ========== \\ local FoodDelivery = Workspace:FindFirstChild("InteractiveJobThings") and Workspace.InteractiveJobThings:FindFirstChild("Food delivery") if not FoodDelivery then error("โŒ 'Food delivery' folder missing") end local PickupFolder = FoodDelivery:FindFirstChild("PickupPoints") local DeliveryFolder = FoodDelivery:FindFirstChild("DeliveryPoints") if not PickupFolder or not DeliveryFolder then error("โŒ Pickup/Delivery folders missing") end -- // ========== UI ========== \\ local function createUI() if gui then gui:Destroy() end gui = Instance.new("ScreenGui") gui.Name = "YoungStreetAutofarm" gui.ResetOnSpawn = false gui.Parent = LocalPlayer:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 260, 0, 210) frame.Position = UDim2.new(0.5, -130, 0.5, -105) frame.BackgroundColor3 = Color3.fromRGB(20, 20, 25) frame.BackgroundTransparency = 0.15 frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true frame.Parent = gui -- Title local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0.15, 0) title.Position = UDim2.new(0, 0, 0, 0) title.BackgroundTransparency = 1 title.Text = "๐Ÿฅก Young Street Autofarm" title.TextColor3 = Color3.fromRGB(255, 200, 100) title.Font = Enum.Font.SourceSansBold title.TextSize = 15 title.Parent = frame statusLabel = Instance.new("TextLabel") statusLabel.Size = UDim2.new(1, 0, 0.2, 0) statusLabel.Position = UDim2.new(0, 0, 0.15, 0) statusLabel.BackgroundTransparency = 1 statusLabel.Text = "๐Ÿ”ด Idle" statusLabel.TextColor3 = Color3.fromRGB(200, 200, 200) statusLabel.Font = Enum.Font.SourceSans statusLabel.TextSize = 13 statusLabel.Parent = frame subStatusLabel = Instance.new("TextLabel") subStatusLabel.Size = UDim2.new(1, 0, 0.18, 0) subStatusLabel.Position = UDim2.new(0, 0, 0.32, 0) subStatusLabel.BackgroundTransparency = 1 subStatusLabel.Text = "" subStatusLabel.TextColor3 = Color3.fromRGB(150, 150, 150) subStatusLabel.Font = Enum.Font.SourceSans subStatusLabel.TextSize = 12 subStatusLabel.Parent = frame -- Pickup cooldown local pickupLabel = Instance.new("TextLabel") pickupLabel.Size = UDim2.new(0.45, 0, 0.13, 0) pickupLabel.Position = UDim2.new(0.02, 0, 0.5, 0) pickupLabel.BackgroundTransparency = 1 pickupLabel.Text = "Pickup CD:" pickupLabel.TextColor3 = Color3.fromRGB(220, 220, 220) pickupLabel.Font = Enum.Font.SourceSans pickupLabel.TextSize = 12 pickupLabel.TextXAlignment = Enum.TextXAlignment.Right pickupLabel.Parent = frame local pickupSlider = Instance.new("TextBox") pickupSlider.Size = UDim2.new(0.3, 0, 0.13, 0) pickupSlider.Position = UDim2.new(0.48, 0, 0.5, 0) pickupSlider.BackgroundColor3 = Color3.fromRGB(40, 40, 50) pickupSlider.TextColor3 = Color3.fromRGB(255, 255, 255) pickupSlider.Font = Enum.Font.SourceSans pickupSlider.TextSize = 13 pickupSlider.Text = tostring(Config.PickupCooldown) pickupSlider.PlaceholderText = "60" pickupSlider.Parent = frame pickupSlider:GetPropertyChangedSignal("Text"):Connect(function() local val = tonumber(pickupSlider.Text) if val == nil then pickupSlider.Text = "0" Config.PickupCooldown = 0 else val = math.max(0, math.floor(val)) Config.PickupCooldown = val end end) -- Delivery cooldown local deliveryLabel = Instance.new("TextLabel") deliveryLabel.Size = UDim2.new(0.45, 0, 0.13, 0) deliveryLabel.Position = UDim2.new(0.02, 0, 0.65, 0) deliveryLabel.BackgroundTransparency = 1 deliveryLabel.Text = "Delivery CD:" deliveryLabel.TextColor3 = Color3.fromRGB(220, 220, 220) deliveryLabel.Font = Enum.Font.SourceSans deliveryLabel.TextSize = 12 deliveryLabel.TextXAlignment = Enum.TextXAlignment.Right deliveryLabel.Parent = frame local deliverySlider = Instance.new("TextBox") deliverySlider.Size = UDim2.new(0.3, 0, 0.13, 0) deliverySlider.Position = UDim2.new(0.48, 0, 0.65, 0) deliverySlider.BackgroundColor3 = Color3.fromRGB(40, 40, 50) deliverySlider.TextColor3 = Color3.fromRGB(255, 255, 255) deliverySlider.Font = Enum.Font.SourceSans deliverySlider.TextSize = 13 deliverySlider.Text = tostring(Config.DeliveryCooldown) deliverySlider.PlaceholderText = "60" deliverySlider.Parent = frame deliverySlider:GetPropertyChangedSignal("Text"):Connect(function() local val = tonumber(deliverySlider.Text) if val == nil then deliverySlider.Text = "0" Config.DeliveryCooldown = 0 else val = math.max(0, math.floor(val)) Config.DeliveryCooldown = val end end) toggleButton = Instance.new("TextButton") toggleButton.Size = UDim2.new(0.4, -5, 0.15, 0) toggleButton.Position = UDim2.new(0.05, 0, 0.82, 0) toggleButton.BackgroundColor3 = Color3.fromRGB(0, 180, 80) toggleButton.Text = "โ–ถ Start" toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) toggleButton.Font = Enum.Font.SourceSansBold toggleButton.TextSize = 15 toggleButton.BorderSizePixel = 0 toggleButton.Parent = frame local killBtn = Instance.new("TextButton") killBtn.Size = UDim2.new(0.4, -5, 0.15, 0) killBtn.Position = UDim2.new(0.55, 0, 0.82, 0) killBtn.BackgroundColor3 = Color3.fromRGB(200, 30, 30) killBtn.Text = "๐Ÿ’€ Kill" killBtn.TextColor3 = Color3.fromRGB(255, 255, 255) killBtn.Font = Enum.Font.SourceSansBold killBtn.TextSize = 15 killBtn.BorderSizePixel = 0 killBtn.Parent = frame toggleButton.MouseButton1Click:Connect(function() if not farmActive then startFarming() else stopFarming() end end) killBtn.MouseButton1Click:Connect(function() killSwitch() end) return gui end local function setStatus(text, color) if statusLabel then statusLabel.Text = text if color then statusLabel.TextColor3 = color end end end local function setSubStatus(text, color) if subStatusLabel then subStatusLabel.Text = text if color then subStatusLabel.TextColor3 = color end end end -- // ========== SCANNERS (NO FALLBACK) ========== \\ local function scanPickupPoints() local list = {} for _, child in ipairs(PickupFolder:GetChildren()) do local prompt = child:FindFirstChildOfClass("ProximityPrompt") local billboard = child:FindFirstChildOfClass("BillboardGui") if prompt and billboard then local isActive = billboard.Enabled == true table.insert(list, { Part = child, Prompt = prompt, Billboard = billboard, IsActive = isActive, Position = child.Position, CFrame = child.CFrame }) end end -- Sort: active first, then distance table.sort(list, function(a, b) if a.IsActive and not b.IsActive then return true end if b.IsActive and not a.IsActive then return false end return (RootPart.Position - a.Position).Magnitude < (RootPart.Position - b.Position).Magnitude end) return list end local function scanDeliveryPoints() local list = {} for _, child in ipairs(DeliveryFolder:GetChildren()) do if child.Name == "Delivery" then local prompt = child:FindFirstChildOfClass("ProximityPrompt") local billboard = child:FindFirstChildOfClass("BillboardGui") if prompt and prompt:IsA("ProximityPrompt") then local isActive = billboard and billboard.Enabled == true or false table.insert(list, { Part = child, Prompt = prompt, Billboard = billboard, IsActive = isActive, Position = child.Position, CFrame = child.CFrame }) end end end table.sort(list, function(a, b) if a.IsActive and not b.IsActive then return true end if b.IsActive and not a.IsActive then return false end return (RootPart.Position - a.Position).Magnitude < (RootPart.Position - b.Position).Magnitude end) return list end -- Returns the first active point, or nil if none found within timeout local function getActivePoint(scanFunction, timeout) timeout = timeout or Config.ActiveScanTimeout local start = tick() repeat local points = scanFunction() if #points > 0 and points[1].IsActive then return points[1] end if not farmActive then return nil end task.wait(0.3) until tick() - start > timeout -- No active point found โ€“ return nil (no fallback!) return nil end -- // ========== TELEPORT ========== \\ local function flyTo(target) if not RootPart then return false end local cframe if typeof(target) == "Vector3" then cframe = CFrame.new(target + Vector3.new(0, Config.FlyHeightOffset, 0)) elseif typeof(target) == "CFrame" then cframe = target + Vector3.new(0, Config.FlyHeightOffset, 0) else return false end if Config.TeleportStyle == "Instant" then RootPart.CFrame = cframe return true elseif Config.TeleportStyle == "Stepped" then local startPos = RootPart.Position local targetPos = cframe.Position local distance = (targetPos - startPos).Magnitude local stepSize = 50 local steps = math.max(math.ceil(distance / stepSize), 1) for i = 1, steps do if not farmActive then return false end local fraction = i / steps local newPos = startPos:Lerp(targetPos, fraction) RootPart.CFrame = CFrame.new(newPos) task.wait() end RootPart.CFrame = cframe return true end return false end -- // ========== PROMPT FIRING ========== \\ local function firePrompt(prompt, holdTime) holdTime = holdTime or Config.PromptHoldTime if not prompt or not prompt.Parent then return false end if fireproximityprompt then fireproximityprompt(prompt, holdTime) return true end -- fallback: simulate F key local part = prompt.Parent if part and part:IsA("BasePart") then local cam = workspace.CurrentCamera local pos, onScreen = cam:WorldToScreenPoint(part.Position) if onScreen then VirtualInput:SendMouseMoveEvent(pos.X, pos.Y, 0) task.wait(0.1) VirtualInput:SendKeyEvent(true, Enum.KeyCode.F, false) task.wait(holdTime) VirtualInput:SendKeyEvent(false, Enum.KeyCode.F, false) return true else VirtualInput:SendKeyEvent(true, Enum.KeyCode.F, false) task.wait(holdTime) VirtualInput:SendKeyEvent(false, Enum.KeyCode.F, false) return true end end return false end -- // ========== TOOL CHECK ========== \\ local function isToolEquipped() if not Character then return false end for _, child in ipairs(Character:GetChildren()) do if child:IsA("Tool") and child.Name == Config.ToolName then return true end end return false end local function waitForToolInHand(timeout) timeout = timeout or 5 local start = tick() repeat if not farmActive then return false end task.wait(0.2) if isToolEquipped() then return true end until tick() - start > timeout return false end -- // ========== COOLDOWN WAIT ========== \\ local function waitOutCooldown(duration, label, statusColor) if duration <= 0 then setStatus(label .. " done (0s)!", Color3.fromRGB(100, 255, 100)) return true end local elapsed = 0 while elapsed < duration do if not farmActive then return false end task.wait(1) elapsed = elapsed + 1 local remaining = duration - elapsed if remaining > 0 then setStatus(label .. " " .. remaining .. "s left", statusColor) setSubStatus("") else setStatus(label .. " done!", Color3.fromRGB(100, 255, 100)) setSubStatus("") end end return true end -- // ========== MAIN FARM CYCLE ========== \\ local function farmCycle() -- 1. Find active pickup (must be active, no fallback) setStatus("๐Ÿ” Searching for active Pickup...", Color3.fromRGB(100, 200, 255)) setSubStatus("") local pickup = getActivePoint(scanPickupPoints, Config.ActiveScanTimeout) if not pickup then setStatus("โŒ No active pickup found", Color3.fromRGB(255, 100, 100)) return false end setStatus("๐ŸŽฏ Active Pickup found!", Color3.fromRGB(100, 255, 100)) -- 2. Teleport to pickup setStatus("๐Ÿš€ Flying to pickup...", Color3.fromRGB(100, 200, 255)) flyTo(pickup.Position) -- 3. Fire pickup prompt setStatus("๐Ÿ“ฆ Picking up...", Color3.fromRGB(255, 200, 100)) if not firePrompt(pickup.Prompt, 0.5) then setStatus("โŒ Pickup prompt failed", Color3.fromRGB(255, 100, 100)) return false end -- 4. Wait for tool setStatus("โณ Waiting for Food box...", Color3.fromRGB(255, 200, 100)) if not waitForToolInHand(5) then setStatus("โŒ Tool never appeared โ€“ re-scanning next cycle", Color3.fromRGB(255, 100, 100)) return false end setStatus("โœ… Food box in hand!", Color3.fromRGB(100, 255, 100)) -- 5. Pickup cooldown if not waitOutCooldown(Config.PickupCooldown, "โณ Pickup cooldown", Color3.fromRGB(255, 200, 100)) then return false end -- 6. Find active delivery (must be active) setStatus("๐Ÿ” Searching for active Delivery...", Color3.fromRGB(100, 200, 255)) setSubStatus("") local delivery = getActivePoint(scanDeliveryPoints, Config.ActiveScanTimeout) if not delivery then setStatus("โŒ No active delivery found", Color3.fromRGB(255, 100, 100)) return false end setStatus("๐ŸŽฏ Active Delivery found!", Color3.fromRGB(100, 255, 100)) -- 7. Delivery attempts with repositioning local deliverySuccess = false for attempt = 1, Config.DeliveryMaxAttempts do if not farmActive then return false end setStatus("๐Ÿ“ฌ Delivery attempt " .. attempt .. "/" .. Config.DeliveryMaxAttempts, Color3.fromRGB(255, 200, 100)) -- Different offsets around the part local offsets = { Vector3.new(0, 0, 3), Vector3.new(0, 0, -3), Vector3.new(3, 0, 0), Vector3.new(-3, 0, 0), } local chosenOffset = offsets[(attempt - 1) % #offsets + 1] local partPos = delivery.CFrame.Position local standPos = partPos + chosenOffset local targetCFrame = CFrame.lookAt(standPos, partPos) setStatus("๐Ÿš€ Teleporting to delivery position " .. attempt, Color3.fromRGB(100, 200, 255)) flyTo(targetCFrame) task.wait(0.3) setStatus("๐Ÿ“ฌ Firing delivery prompt...", Color3.fromRGB(255, 200, 100)) local fireOk = firePrompt(delivery.Prompt, 0.5) if not fireOk then VirtualInput:SendKeyEvent(true, Enum.KeyCode.F, false) task.wait(0.5) VirtualInput:SendKeyEvent(false, Enum.KeyCode.F, false) end task.wait(1.5) if not isToolEquipped() then deliverySuccess = true setStatus("โœ… Delivery success!", Color3.fromRGB(100, 255, 100)) break else setStatus("โš ๏ธ Tool still in hand, retrying...", Color3.fromRGB(255, 200, 50)) task.wait(1) end end if not deliverySuccess then setStatus("โš ๏ธ Delivery failed after " .. Config.DeliveryMaxAttempts .. " attempts", Color3.fromRGB(255, 100, 100)) -- We still proceed to cooldown, but we'll return false so the main loop can retry -- However, we want to wait for delivery cooldown anyway? Let's wait and then return false. -- Actually, if delivery failed, we might want to reset and try again from pickup. -- So we'll skip the delivery cooldown and return false, so the whole cycle retries. return false end -- 8. Delivery cooldown if not waitOutCooldown(Config.DeliveryCooldown, "โณ Delivery cooldown", Color3.fromRGB(255, 200, 100)) then return false end setStatus("โœ… Cycle complete!", Color3.fromRGB(100, 255, 100)) setSubStatus("") return true end -- // ========== MAIN LOOP ========== \\ local function mainFarmLoop() while farmActive do local success = false for retry = 1, Config.MaxRetries do if not farmActive then break end success = farmCycle() if success then break end setStatus("๐Ÿ”„ Retry " .. retry .. "/" .. Config.MaxRetries, Color3.fromRGB(255, 200, 50)) task.wait(Config.RetryDelay) end if not farmActive then break end if not success then setStatus("โ›” All retries failed. Rescanning in 5s...", Color3.fromRGB(255, 100, 100)) task.wait(5) end end if not farmActive then setStatus("๐Ÿ”ด Stopped", Color3.fromRGB(200, 200, 200)) setSubStatus("") if toggleButton then toggleButton.Text = "โ–ถ Start" end end end -- // ========== CONTROL FUNCTIONS ========== \\ function startFarming() if farmActive then return end print("โ–ถ Starting farm...") farmActive = true if toggleButton then toggleButton.Text = "โน Stop" end setStatus("๐ŸŸข Starting...", Color3.fromRGB(100, 255, 100)) setSubStatus("") farmCoroutine = coroutine.create(mainFarmLoop) coroutine.resume(farmCoroutine) end function stopFarming() if not farmActive then return end print("โน Stopping farm...") farmActive = false if toggleButton then toggleButton.Text = "โ–ถ Start" end setStatus("๐Ÿ”ด Stopped", Color3.fromRGB(200, 200, 200)) setSubStatus("") end function killSwitch() print("๐Ÿ’€ Kill switch activated. Cleaning up...") farmActive = false if charAddedConn then charAddedConn:Disconnect() charAddedConn = nil end if gui then gui:Destroy() gui = nil statusLabel = nil subStatusLabel = nil toggleButton = nil end farmCoroutine = nil if Humanoid then Humanoid.WalkSpeed = 16 end print("๐Ÿงน Autofarm fully cleaned up. Game is pristine.") end -- // ========== CHARACTER RESPAWN ========== \\ charAddedConn = LocalPlayer.CharacterAdded:Connect(function(newChar) Character = newChar Humanoid = Character:WaitForChild("Humanoid") RootPart = Character:WaitForChild("HumanoidRootPart") print("๐Ÿ”„ Character respawned.") if farmActive then setStatus("๐Ÿ”„ Respawned, continuing...", Color3.fromRGB(255, 200, 100)) end end) -- // ========== BOOT ========== \\ if not Character or not Humanoid then LocalPlayer.CharacterAdded:Wait() Character = LocalPlayer.Character Humanoid = Character:WaitForChild("Humanoid") RootPart = Character:WaitForChild("HumanoidRootPart") end createUI() setStatus("๐ŸŸข Idle - Press Start", Color3.fromRGB(100, 200, 255)) setSubStatus("") print("๐Ÿš€ V13 Loaded: No anti-AFK, no fallback to nearest, re-scan on failure.")