Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --roblox islands pickup test, kimi.com--
- --info for me: make a script for red berry seeds, goes to as many red berry seeds until AC, then wait 3-5 seconds, redo.--
- --change the code so it just looks down from above and clicks F on berry seeds--
- -- ============================================
- -- CONFIG: CHANGE THIS TO YOUR ITEM NAME
- -- ============================================
- local ITEM_NAME = "workbench0" -- <-- REPLACE THIS WITH ANY ITEM NAME
- -- SETTINGS
- local MAX_CAM_DISTANCE = 0 -- Force first person (0 = closest)
- local RETRY_COUNT = 5 -- How many teleport attempts
- local TELEPORT_OFFSETS = { -- Different positions to try
- Vector3.new(0, 3, 2), -- Close in front
- Vector3.new(0, 2, 1), -- Very close
- Vector3.new(0, 4, 3), -- Slightly higher
- Vector3.new(0, 1, 0.5), -- Almost inside
- Vector3.new(0, 5, 4), -- Higher angle
- }
- -- ============================================
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local camera = game.Workspace.CurrentCamera
- local VirtualInputManager = game:GetService("VirtualInputManager")
- -- Save original settings
- local originalMaxZoom = player.CameraMaxZoomDistance
- local originalMinZoom = player.CameraMinZoomDistance
- local originalCameraCF = camera.CFrame
- -- Force first person
- player.CameraMaxZoomDistance = MAX_CAM_DISTANCE
- player.CameraMinZoomDistance = MAX_CAM_DISTANCE
- -- Find ALL items with that name
- local items = {}
- for _, obj in ipairs(game.Workspace:GetDescendants()) do
- if obj.Name == ITEM_NAME and obj:IsA("BasePart") then
- table.insert(items, obj)
- end
- end
- if #items > 0 then
- -- Pick random item if multiple exist
- local item = items[math.random(1, #items)]
- local targetPos = item.Position
- local success = false
- -- Try multiple positions and spam F
- for i = 1, RETRY_COUNT do
- local offset = TELEPORT_OFFSETS[i] or TELEPORT_OFFSETS[1]
- -- Free cam to item
- camera.CameraType = Enum.CameraType.Scriptable
- camera.CFrame = CFrame.new(targetPos + offset, targetPos)
- -- Center mouse
- local centerX = camera.ViewportSize.X / 2
- local centerY = camera.ViewportSize.Y / 2
- VirtualInputManager:SendMouseMoveEvent(centerX, centerY, game)
- -- Teleport body to camera
- humanoidRootPart.CFrame = camera.CFrame
- -- Spam F multiple times per position
- for f = 1, 3 do
- VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.F, false, game)
- VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.F, false, game)
- task.wait(0.01)
- end
- task.wait(0.02)
- -- Check if menu opened (you can add detection here if needed)
- end
- -- Restore settings
- player.CameraMaxZoomDistance = originalMaxZoom
- player.CameraMinZoomDistance = originalMinZoom
- camera.CameraType = Enum.CameraType.Custom
- camera.CFrame = originalCameraCF
- else
- -- Restore even if not found
- player.CameraMaxZoomDistance = originalMaxZoom
- player.CameraMinZoomDistance = originalMinZoom
- end
Advertisement