--[[ Roblox Cheathub Script: Automatic Little Rainbow Farm with Toggle Press "F" to enable/disable the farm. --]] -- Services local Players = game:GetService("Players") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local Workspace = game:GetService("Workspace") local UIS = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local HumanoidRoot = Character:WaitForChild("HumanoidRootPart") -- Config local FARM_DISTANCE = 5 -- studs to trigger collection local SEARCH_INTERVAL = 0.5 -- seconds between scans local MOVE_SPEED = 16 -- walk speed while farming local TOGGLE_KEY = Enum.KeyCode.F -- key to toggle -- State local targetRainbow = nil local isFarming = false local isEnabled = true -- starts enabled; toggle with F -- ------------------------------------------------- -- Keybind handling UIS.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == TOGGLE_KEY then isEnabled = not isEnabled if not isEnabled then -- Immediately stop any ongoing tween TweenService:Create(HumanoidRoot, TweenInfo.new(0), {CFrame = HumanoidRoot.CFrame}):Play() print("Rainbow farm paused") else print("Rainbow farm resumed") end end end) -- ------------------------------------------------- -- Utility: locate the nearest LittleRainbow object local function findNearestRainbow() local nearest, shortest = nil, math.huge for _, obj in ipairs(Workspace:GetDescendants()) do if obj.Name == "LittleRainbow" and obj:IsA("BasePart") then local dist = (obj.Position - HumanoidRoot.Position).magnitude if dist < shortest then shortest = dist nearest = obj end end end return nearest end -- Smooth movement toward a target position local function moveToTarget(targetPos) local distance = (targetPos - HumanoidRoot.Position).magnitude local tweenInfo = TweenInfo.new(distance / MOVE_SPEED, Enum.EasingStyle.Linear) local tween = TweenService:Create(HumanoidRoot, tweenInfo, {CFrame = CFrame.new(targetPos)}) tween:Play() tween.Completed:Wait() end -- Main loop (runs every RenderStepped) RunService.RenderStepped:Connect(function() if not isEnabled then return end -- <-- respects toggle if not isFarming then targetRainbow = findNearestRainbow() if targetRainbow then isFarming = true moveToTarget(targetRainbow.Position) end else if targetRainbow and (targetRainbow.Position - HumanoidRoot.Position).magnitude <= FARM_DISTANCE then -- Try ClickDetector first, then ProximityPrompt local clickDet = targetRainbow:FindFirstChildOfClass("ClickDetector") if clickDet then fireclickdetector(clickDet) else local prompt = targetRainbow:FindFirstChildOfClass("ProximityPrompt") if prompt then prompt:InputHoldBegin() wait(0.2) prompt:InputHoldEnd() end end -- Reset after collection targetRainbow = nil isFarming = false end end end) -- Periodic re‑scan when idle while true do if isEnabled and not isFarming then targetRainbow = findNearestRainbow() if targetRainbow then isFarming = true moveToTarget(targetRainbow.Position) end end wait(SEARCH_INTERVAL) end