-- [[ CONFIGURATION ]] --
_G.AutoFarm = true -- Set to false if you want to stop the script
local collectDelay = 0.5 -- How fast items are collected (seconds)
local sellDelay = 2 -- How fast items are sold (seconds)
-- [[ SERVICES & REMOTES ]] --
local player = game:GetService("Players").LocalPlayer
local reps = game:GetService("ReplicatedStorage")
local plotsFolder = workspace:WaitForChild("plots")
local remotePath = reps:WaitForChild("signals"):WaitForChild("remotes"):WaitForChild("events")
local collectRemote = remotePath:WaitForChild("requestCollection")
local sellRemote = remotePath:WaitForChild("sellInventory")
-- [[ FUNCTIONS ]] --
-- Function to optimize production speeds globally
local function updateProductionSpeeds()
for _, object in ipairs(workspace:GetDescendants()) do
if object.Name == "ProductionSpeed" then
if object:IsA("NumberValue") or object:IsA("IntValue") then
local oldValue = object.Value
object.Value = 0.1
print("Changed Speed from " .. tostring(oldValue) .. " to 0.1 in: " .. object:GetFullName())
end
end
end
end
-- Function to thoroughly search for the player's plot
local function GetMyPlot()
for _, p in pairs(plotsFolder:GetChildren()) do
-- 1. Check from main plot Attributes
if p:GetAttribute("Owner") == player.Name or p:GetAttribute("Owner") == player.UserId then
return p
end
-- 2. Check within sub-models and PlayerPlotIcon
local subPlot = p:FindFirstChild("plot")
if subPlot then
if subPlot:GetAttribute("Owner") == player.Name or subPlot:GetAttribute("Owner") == player.UserId then
return p
end
local icon = subPlot:FindFirstChild("PlayerPlotIcon")
if icon and (icon:GetAttribute("Owner") == player.Name or icon:GetAttribute("Owner") == player.UserId) then
return p
end
end
-- 3. Check every Value Object hidden inside the plot
for _, obj in pairs(p:GetDescendants()) do
if obj:IsA("StringValue") or obj:IsA("ObjectValue") then
if obj.Value == player.Name or obj.Value == player then
return p
end
end
end
end
return nil
end
-- [[ INITIALIZATION ]] --
-- Run speed optimization once at the start
updateProductionSpeeds()
-- Update any new production objects added later
workspace.DescendantAdded:Connect(function(descendant)
if descendant.Name == "ProductionSpeed" then
if descendant:IsA("NumberValue") or descendant:IsA("IntValue") then
descendant.Value = 0.1
print("New ProductionSpeed detected and set to 0.1 in: " .. descendant:GetFullName())
end
end
end)
-- [[ MAIN SYSTEM ]] --
print("Searching for your Plot...")
local myPlot = GetMyPlot()
-- Loop until plot is found
while not myPlot and _G.AutoFarm do
task.wait(2)
myPlot = GetMyPlot()
end
if myPlot then
print("✅ Found your Plot: " .. myPlot.Name .. " | Starting Auto Farm!")
-- Part 1: Auto Collection
task.spawn(function()
while _G.AutoFarm do
if myPlot then
local itemHolder = myPlot:FindFirstChild("itemHolder")
if itemHolder then
for _, item in pairs(itemHolder:GetChildren()) do
if not _G.AutoFarm then break end
collectRemote:FireServer(item)
end
end
end
task.wait(collectDelay)
end
end)
-- Part 2: Auto Sell
task.spawn(function()
while _G.AutoFarm do
sellRemote:FireServer()
task.wait(sellDelay)
end
end)
else
warn("❌ System Error: Plot not found.")
end
print("Made By namesicklyy!")autofarm by namesicklyy
No comments yet. Be the first to comment!
1-- [[ CONFIGURATION ]] --
2_G.AutoFarm = true -- Set to false if you want to stop the script
3local collectDelay = 0.5 -- How fast items are collected (seconds)
4local sellDelay = 2 -- How fast items are sold (seconds)
5
6-- [[ SERVICES & REMOTES ]] --
7local player = game:GetService("Players").LocalPlayer
8local reps = game:GetService("ReplicatedStorage")
9local plotsFolder = workspace:WaitForChild("plots")
10local remotePath = reps:WaitForChild("signals"):WaitForChild("remotes"):WaitForChild("events")
11
12local collectRemote = remotePath:WaitForChild("requestCollection")
13local sellRemote = remotePath:WaitForChild("sellInventory")
14
15-- [[ FUNCTIONS ]] --
16
17-- Function to optimize production speeds globally
18local function updateProductionSpeeds()
19 for _, object in ipairs(workspace:GetDescendants()) do
20 if object.Name == "ProductionSpeed" then
21 if object:IsA("NumberValue") or object:IsA("IntValue") then
22 local oldValue = object.Value
23 object.Value = 0.1
24 print("Changed Speed from " .. tostring(oldValue) .. " to 0.1 in: " .. object:GetFullName())
25 end
26 end
27 end
28end
29
30-- Function to thoroughly search for the player's plot
31local function GetMyPlot()
32 for _, p in pairs(plotsFolder:GetChildren()) do
33 -- 1. Check from main plot Attributes
34 if p:GetAttribute("Owner") == player.Name or p:GetAttribute("Owner") == player.UserId then
35 return p
36 end
37
38 -- 2. Check within sub-models and PlayerPlotIcon
39 local subPlot = p:FindFirstChild("plot")
40 if subPlot then
41 if subPlot:GetAttribute("Owner") == player.Name or subPlot:GetAttribute("Owner") == player.UserId then
42 return p
43 end
44
45 local icon = subPlot:FindFirstChild("PlayerPlotIcon")
46 if icon and (icon:GetAttribute("Owner") == player.Name or icon:GetAttribute("Owner") == player.UserId) then
47 return p
48 end
49 end
50
51 -- 3. Check every Value Object hidden inside the plot
52 for _, obj in pairs(p:GetDescendants()) do
53 if obj:IsA("StringValue") or obj:IsA("ObjectValue") then
54 if obj.Value == player.Name or obj.Value == player then
55 return p
56 end
57 end
58 end
59 end
60 return nil
61end
62
63-- [[ INITIALIZATION ]] --
64
65-- Run speed optimization once at the start
66updateProductionSpeeds()
67
68-- Update any new production objects added later
69workspace.DescendantAdded:Connect(function(descendant)
70 if descendant.Name == "ProductionSpeed" then
71 if descendant:IsA("NumberValue") or descendant:IsA("IntValue") then
72 descendant.Value = 0.1
73 print("New ProductionSpeed detected and set to 0.1 in: " .. descendant:GetFullName())
74 end
75 end
76end)
77
78-- [[ MAIN SYSTEM ]] --
79print("Searching for your Plot...")
80local myPlot = GetMyPlot()
81
82-- Loop until plot is found
83while not myPlot and _G.AutoFarm do
84 task.wait(2)
85 myPlot = GetMyPlot()
86end
87
88if myPlot then
89 print("✅ Found your Plot: " .. myPlot.Name .. " | Starting Auto Farm!")
90
91 -- Part 1: Auto Collection
92 task.spawn(function()
93 while _G.AutoFarm do
94 if myPlot then
95 local itemHolder = myPlot:FindFirstChild("itemHolder")
96 if itemHolder then
97 for _, item in pairs(itemHolder:GetChildren()) do
98 if not _G.AutoFarm then break end
99 collectRemote:FireServer(item)
100 end
101 end
102 end
103 task.wait(collectDelay)
104 end
105 end)
106
107 -- Part 2: Auto Sell
108 task.spawn(function()
109 while _G.AutoFarm do
110 sellRemote:FireServer()
111 task.wait(sellDelay)
112 end
113 end)
114
115else
116 warn("❌ System Error: Plot not found.")
117end
118
119print("Made By namesicklyy!")