ADVERTISEMENTREMOVE ADS
Game icon

Auto Collect

Script preview thumbnail
Script Preview

Description

Turn on to auto collect OBJECTS.
I will not be upgrading this script.

This script is future proof as long as they don't change the name of OBJECTS to something else.
Do not say it doesn't work without trying solara.

Features:

  • auto collection

Tested with

ADVERTISEMENTREMOVE ADS
232 Lines • 6.94 KiB
Raw
--[[
Object Collector. (Space UI) — drag from anywhere inside panel
• Buttons still click if you don't drag
• If you drag (>6px), the click is ignored (so you don't accidentally press)
• Close turns OFF and removes UI
Drop as a LocalScript (e.g., StarterPlayerScripts)
]]
-------------------------
-- Services
-------------------------
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
-- cleanup old
local old = PlayerGui:FindFirstChild("SpaceCollectorUI")
if old then old:Destroy() end
-------------------------
-- Root GUI + Stars
-------------------------
local Gui = Instance.new("ScreenGui")
Gui.Name = "SpaceCollectorUI"
Gui.IgnoreGuiInset = true
Gui.ResetOnSpawn = false
Gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
Gui.Parent = PlayerGui
-- star field (background)
for i = 1, 36 do
local star = Instance.new("Frame")
star.ZIndex = 0
star.Size = UDim2.fromOffset(math.random(1,3), math.random(1,3))
star.Position = UDim2.new(math.random(),0, math.random(),0)
star.BackgroundColor3 = Color3.fromRGB(255,255,255)
star.BackgroundTransparency = math.random(60,90)/100
star.BorderSizePixel = 0
star.Parent = Gui
TweenService:Create(
star,
TweenInfo.new(math.random(4,10), Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, true),
{BackgroundTransparency = 1}
):Play()
end
-------------------------
-- Panel
-------------------------
local Panel = Instance.new("Frame")
Panel.Name = "Panel"
Panel.ZIndex = 1
Panel.Size = UDim2.fromOffset(270, 124)
Panel.Position = UDim2.new(0.5, -135, 0.38, -62)
Panel.BackgroundColor3 = Color3.fromRGB(10, 12, 28)
Panel.BackgroundTransparency = 0.05
Panel.BorderSizePixel = 0
Panel.Parent = Gui
Instance.new("UICorner", Panel).CornerRadius = UDim.new(0, 12)
local Stroke = Instance.new("UIStroke", Panel)
Stroke.Thickness = 2
Stroke.Color = Color3.fromRGB(0, 200, 255)
Stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
local Title = Instance.new("TextLabel")
Title.Name = "Title"
Title.ZIndex = 2
Title.BackgroundTransparency = 1
Title.Size = UDim2.new(1, -40, 0, 30)
Title.Position = UDim2.fromOffset(12, 6)
Title.Text = "Object Collector 🚀"
Title.Font = Enum.Font.GothamBold
Title.TextSize = 18
Title.TextColor3 = Color3.fromRGB(150, 230, 255)
Title.TextXAlignment = Enum.TextXAlignment.Left
Title.Parent = Panel
local Close = Instance.new("TextButton")
Close.Name = "Close"
Close.ZIndex = 2
Close.Size = UDim2.fromOffset(26, 26)
Close.Position = UDim2.new(1, -32, 0, 6)
Close.BackgroundColor3 = Color3.fromRGB(25, 25, 40)
Close.Text = "✖"
Close.Font = Enum.Font.GothamBold
Close.TextSize = 14
Close.TextColor3 = Color3.fromRGB(255, 100, 100)
Close.AutoButtonColor = false
Close.Parent = Panel
Instance.new("UICorner", Close).CornerRadius = UDim.new(0, 6)
local Toggle = Instance.new("TextButton")
Toggle.Name = "Toggle"
Toggle.ZIndex = 2
Toggle.Size = UDim2.new(1, -24, 0, 46)
Toggle.Position = UDim2.fromOffset(12, 50)
Toggle.BackgroundColor3 = Color3.fromRGB(30, 30, 60)
Toggle.Text = "OFF"
Toggle.Font = Enum.Font.GothamBold
Toggle.TextSize = 22
Toggle.TextColor3 = Color3.fromRGB(180, 220, 255)
Toggle.AutoButtonColor = false
Toggle.Parent = Panel
Instance.new("UICorner", Toggle).CornerRadius = UDim.new(0, 10)
local Hint = Instance.new("TextLabel")
Hint.Name = "Hint"
Hint.ZIndex = 2
Hint.BackgroundTransparency = 1
Hint.Size = UDim2.new(1, -24, 0, 18)
Hint.Position = UDim2.fromOffset(12, 100)
Hint.Text = "Credit: Chimera__Gaming"
Hint.Font = Enum.Font.Gotham
Hint.TextSize = 12
Hint.TextColor3 = Color3.fromRGB(130, 170, 255)
Hint.TextXAlignment = Enum.TextXAlignment.Left
Hint.Parent = Panel
-------------------------
-- Drag from ANYWHERE inside the panel (incl. over buttons)
-------------------------
local dragging = false
local didDrag = false
local dragStartMouse: Vector2? = nil
local startPos: UDim2? = nil
local lastDragAt = 0
local THRESH = 6 -- px to qualify as a drag
local function mouseInPanel()
local m = UIS:GetMouseLocation()
-- Account for topbar offset (GetMouseLocation includes it), Panel.AbsolutePosition also includes it
local p = Panel.AbsolutePosition
local s = Panel.AbsoluteSize
return m.X >= p.X and m.X <= p.X + s.X and m.Y >= p.Y and m.Y <= p.Y + s.Y
end
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and mouseInPanel() then
dragging = true
didDrag = false
dragStartMouse = UIS:GetMouseLocation()
startPos = Panel.Position
end
end)
UIS.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement and dragStartMouse and startPos then
local m = UIS:GetMouseLocation()
local dx, dy = m.X - dragStartMouse.X, m.Y - dragStartMouse.Y
if not didDrag and (math.abs(dx) > THRESH or math.abs(dy) > THRESH) then
didDrag = true
end
Panel.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + dx, startPos.Y.Scale, startPos.Y.Offset + dy)
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if dragging and didDrag then
lastDragAt = os.clock()
end
dragging = false
didDrag = false
dragStartMouse = nil
startPos = nil
end
end)
-- Ignore button clicks that happen immediately after a drag (prevents accidental toggles)
local function justDragged()
return (os.clock() - lastDragAt) < 0.12
end
-------------------------
-- Collector logic
-------------------------
local running = false
local interval = 0 -- raise if lag
local Events = ReplicatedStorage:FindFirstChild("Events")
local CollectEvent = Events and Events:FindFirstChild("CollectObject")
local function setVisual(isOn)
if isOn then
Toggle.Text = "ON 🌠"
Toggle.BackgroundColor3 = Color3.fromRGB(40, 0, 120)
Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
else
Toggle.Text = "OFF"
Toggle.BackgroundColor3 = Color3.fromRGB(30, 30, 60)
Toggle.TextColor3 = Color3.fromRGB(180, 220, 255)
end
end
local function loop()
while running and Gui.Parent do
local folder = Workspace:FindFirstChild("Objects")
if folder and CollectEvent then
for _, obj in ipairs(folder:GetChildren()) do
local id = tonumber(obj.Name)
if id then
pcall(function()
CollectEvent:FireServer(id)
obj:Destroy()
end)
end
end
end
task.wait(interval)
end
end
Toggle.MouseButton1Click:Connect(function()
if justDragged() then return end
running = not running
setVisual(running)
if running then task.spawn(loop) end
end)
Close.MouseButton1Click:Connect(function()
if justDragged() then return end
running = false
Gui:Destroy()
end)
setVisual(false)
ADVERTISEMENTREMOVE ADS

Comments

0 comments
to add a comment
Loading comments
ADVERTISEMENTREMOVE ADS