local oldUi = game:GetService("CoreGui"):FindFirstChild("BlockTycoonPayloadUI") or
game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("BlockTycoonPayloadUI")
if oldUi then
oldUi:Destroy()
end
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "BlockTycoonPayloadUI"
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local success, coreGui = pcall(function() return game:GetService("CoreGui") end)
ScreenGui.Parent = success and coreGui or game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 380, 0, 420)
MainFrame.Position = UDim2.new(0.5, -190, 0.4, -210)
MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Parent = ScreenGui
local FrameCorner = Instance.new("UICorner")
FrameCorner.CornerRadius = UDim.new(0, 8)
FrameCorner.Parent = MainFrame
local FrameStroke = Instance.new("UIStroke")
FrameStroke.Color = Color3.fromRGB(50, 50, 60)
FrameStroke.Thickness = 1
FrameStroke.Parent = MainFrame
local TitleBar = Instance.new("Frame")
TitleBar.Name = "TitleBar"
TitleBar.Size = UDim2.new(1, 0, 0, 40)
TitleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
TitleBar.BorderSizePixel = 0
TitleBar.Parent = MainFrame
local TitleCorner = Instance.new("UICorner")
TitleCorner.CornerRadius = UDim.new(0, 8)
TitleCorner.Parent = TitleBar
local TitleText = Instance.new("TextLabel")
TitleText.Size = UDim2.new(1, -90, 1, 0)
TitleText.Position = UDim2.new(0, 15, 0, 0)
TitleText.BackgroundTransparency = 1
TitleText.Text = "Bulk Payload Auto-Buyer [Numpad1]"
TitleText.TextColor3 = Color3.fromRGB(240, 240, 240)
TitleText.TextSize = 14
TitleText.Font = Enum.Font.GothamBold
TitleText.TextXAlignment = Enum.TextXAlignment.Left
TitleText.Parent = TitleBar
local CloseButton = Instance.new("TextButton")
CloseButton.Name = "CloseButton"
CloseButton.Size = UDim2.new(0, 30, 0, 30)
CloseButton.Position = UDim2.new(1, -35, 0, 5)
CloseButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
CloseButton.Text = "X"
CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
CloseButton.TextSize = 14
CloseButton.Font = Enum.Font.GothamBold
CloseButton.Parent = TitleBar
local CloseCorner = Instance.new("UICorner")
CloseCorner.CornerRadius = UDim.new(0, 6)
CloseCorner.Parent = CloseButton
local ContentFrame = Instance.new("Frame")
ContentFrame.Name = "ContentFrame"
ContentFrame.Size = UDim2.new(1, -24, 1, -55)
ContentFrame.Position = UDim2.new(0, 12, 0, 45)
ContentFrame.BackgroundTransparency = 1
ContentFrame.Parent = MainFrame
local DropdownButton = Instance.new("TextButton")
DropdownButton.Name = "DropdownButton"
DropdownButton.Size = UDim2.new(1, 0, 0, 38)
DropdownButton.Position = UDim2.new(0, 0, 0, 10)
DropdownButton.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
DropdownButton.Text = "Select Item â–¼"
DropdownButton.TextColor3 = Color3.fromRGB(220, 220, 220)
DropdownButton.TextSize = 14
DropdownButton.Font = Enum.Font.GothamSemibold
DropdownButton.Parent = ContentFrame
local DropdownCorner = Instance.new("UICorner")
DropdownCorner.CornerRadius = UDim.new(0, 6)
DropdownCorner.Parent = DropdownButton
local DropdownContainer = Instance.new("Frame")
DropdownContainer.Name = "DropdownContainer"
DropdownContainer.Size = UDim2.new(1, 0, 0, 180)
DropdownContainer.Position = UDim2.new(0, 0, 0, 52)
DropdownContainer.BackgroundTransparency = 1
DropdownContainer.Visible = false
DropdownContainer.ZIndex = 5
DropdownContainer.Parent = ContentFrame
local SearchInput = Instance.new("TextBox")
SearchInput.Name = "SearchInput"
SearchInput.Size = UDim2.new(1, 0, 0, 32)
SearchInput.Position = UDim2.new(0, 0, 0, 0)
SearchInput.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
SearchInput.PlaceholderText = "🔠Search blocks..."
SearchInput.PlaceholderColor3 = Color3.fromRGB(120, 120, 130)
SearchInput.Text = ""
SearchInput.TextColor3 = Color3.fromRGB(255, 255, 255)
SearchInput.TextSize = 13
SearchInput.Font = Enum.Font.Gotham
SearchInput.ZIndex = 6
SearchInput.Parent = DropdownContainer
local SearchCorner = Instance.new("UICorner")
SearchCorner.CornerRadius = UDim.new(0, 4)
SearchCorner.Parent = SearchInput
local SearchStroke = Instance.new("UIStroke")
SearchStroke.Color = Color3.fromRGB(60, 60, 75)
SearchStroke.Thickness = 1
SearchStroke.Parent = SearchInput
local DropdownList = Instance.new("ScrollingFrame")
DropdownList.Name = "DropdownList"
DropdownList.Size = UDim2.new(1, 0, 1, -38)
DropdownList.Position = UDim2.new(0, 0, 0, 38)
DropdownList.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
DropdownList.BorderSizePixel = 0
DropdownList.ZIndex = 5
DropdownList.CanvasSize = UDim2.new(0, 0, 0, 0)
DropdownList.ScrollBarThickness = 6
DropdownList.Parent = DropdownContainer
local ListLayout = Instance.new("UIListLayout")
ListLayout.Padding = UDim.new(0, 2)
ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
ListLayout.Parent = DropdownList
local AmountLabel = Instance.new("TextLabel")
AmountLabel.Size = UDim2.new(0.5, -5, 0, 25)
AmountLabel.Position = UDim2.new(0, 0, 0, 245)
AmountLabel.BackgroundTransparency = 1
AmountLabel.Text = "Index Quantity Amount:"
AmountLabel.TextColor3 = Color3.fromRGB(180, 180, 190)
AmountLabel.TextSize = 12
AmountLabel.Font = Enum.Font.GothamSemibold
AmountLabel.TextXAlignment = Enum.TextXAlignment.Left
AmountLabel.Parent = ContentFrame
local AmountInput = Instance.new("TextBox")
AmountInput.Size = UDim2.new(0.5, -5, 0, 32)
AmountInput.Position = UDim2.new(0, 0, 0, 270)
AmountInput.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
AmountInput.Text = "2"
AmountInput.TextColor3 = Color3.fromRGB(255, 255, 255)
AmountInput.TextSize = 14
AmountInput.Font = Enum.Font.Gotham
AmountInput.Parent = ContentFrame
local AmountCorner = Instance.new("UICorner")
AmountCorner.CornerRadius = UDim.new(0, 4)
AmountCorner.Parent = AmountInput
local SpeedLabel = Instance.new("TextLabel")
SpeedLabel.Size = UDim2.new(0.5, -5, 0, 25)
SpeedLabel.Position = UDim2.new(0.5, 5, 0, 245)
SpeedLabel.BackgroundTransparency = 1
SpeedLabel.Text = "Execution Delay (Sec):"
SpeedLabel.TextColor3 = Color3.fromRGB(180, 180, 190)
SpeedLabel.TextSize = 12
SpeedLabel.Font = Enum.Font.GothamSemibold
SpeedLabel.TextXAlignment = Enum.TextXAlignment.Left
SpeedLabel.Parent = ContentFrame
local SpeedInput = Instance.new("TextBox")
SpeedInput.Size = UDim2.new(0.5, -5, 0, 32)
SpeedInput.Position = UDim2.new(0.5, 5, 0, 270)
SpeedInput.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
SpeedInput.Text = "0.2"
SpeedInput.TextColor3 = Color3.fromRGB(255, 255, 255)
SpeedInput.TextSize = 14
SpeedInput.Font = Enum.Font.Gotham
SpeedInput.Parent = ContentFrame
local SpeedCorner = Instance.new("UICorner")
SpeedCorner.CornerRadius = UDim.new(0, 4)
SpeedCorner.Parent = SpeedInput
local ToggleButton = Instance.new("TextButton")
ToggleButton.Name = "ToggleButton"
ToggleButton.Size = UDim2.new(1, 0, 0, 42)
ToggleButton.Position = UDim2.new(0, 0, 1, -45)
ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
ToggleButton.Text = "Start Auto-Buy"
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.TextSize = 15
ToggleButton.Font = Enum.Font.GothamBold
ToggleButton.Parent = ContentFrame
local ToggleCorner = Instance.new("UICorner")
ToggleCorner.CornerRadius = UDim.new(0, 6)
ToggleCorner.Parent = ToggleButton
local replicatedStorage = game:GetService("ReplicatedStorage")
local shopRemote = replicatedStorage:WaitForChild("ShopE")
local blocksFolder = replicatedStorage:WaitForChild("Blocks")
local selectedItem = nil
local autoBuyActive = false
local scriptAlive = true
local configQuantity = 2
local configDelay = 0.2
local function populateDropdown()
for _, block in pairs(blocksFolder:GetChildren()) do
local itemBtn = Instance.new("TextButton")
itemBtn.Name = block.Name
itemBtn.Size = UDim2.new(1, -8, 0, 30)
itemBtn.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
itemBtn.Text = block.Name
itemBtn.TextColor3 = Color3.fromRGB(200, 200, 200)
itemBtn.TextSize = 13
itemBtn.Font = Enum.Font.Gotham
itemBtn.ZIndex = 6
itemBtn.Parent = DropdownList
local itemCorner = Instance.new("UICorner")
itemCorner.CornerRadius = UDim.new(0, 4)
itemCorner.Parent = itemBtn
itemBtn.MouseButton1Click:Connect(function()
selectedItem = block.Name
DropdownButton.Text = selectedItem .. " â–¼"
DropdownContainer.Visible = false
SearchInput.Text = ""
end)
end
DropdownList.CanvasSize = UDim2.new(0, 0, 0, ListLayout.AbsoluteContentSize.Y)
end
populateDropdown()
SearchInput:GetPropertyChangedSignal("Text"):Connect(function()
local searchPattern = string.lower(SearchInput.Text)
for _, button in pairs(DropdownList:GetChildren()) do
if button:IsA("TextButton") then
if searchPattern == "" or string.find(string.lower(button.Name), searchPattern) then
button.Visible = true
else
button.Visible = false
end
end
end
DropdownList.CanvasSize = UDim2.new(0, 0, 0, ListLayout.AbsoluteContentSize.Y)
end)
DropdownButton.MouseButton1Click:Connect(function()
DropdownContainer.Visible = not DropdownContainer.Visible
if DropdownContainer.Visible then
SearchInput:CaptureFocus()
end
end)
AmountInput.FocusLost:Connect(function()
local val = tonumber(AmountInput.Text)
if val and val > 0 then configQuantity = math.floor(val) else AmountInput.Text = tostring(configQuantity) end
end)
SpeedInput.FocusLost:Connect(function()
local val = tonumber(SpeedInput.Text)
if val and val >= 0 then configDelay = val else SpeedInput.Text = tostring(configDelay) end
end)
task.spawn(function()
while scriptAlive do
if autoBuyActive and selectedItem then
local ohNumber1 = 1
local ohTable2 = {
[1] = selectedItem,
[2] = configQuantity
}
shopRemote:FireServer(ohNumber1, ohTable2)
end
task.wait(configDelay)
end
end)
ToggleButton.MouseButton1Click:Connect(function()
if not selectedItem then
DropdownButton.Text = "CHOOSE AN ITEM FIRST!"
task.delay(1.5, function() DropdownButton.Text = "Select Item â–¼" end)
return
end
autoBuyActive = not autoBuyActive
if autoBuyActive then
configQuantity = tonumber(AmountInput.Text) or 2
configDelay = tonumber(SpeedInput.Text) or 0.2
ToggleButton.Text = "Stop Auto-Buy"
ToggleButton.BackgroundColor3 = Color3.fromRGB(150, 50, 50)
else
ToggleButton.Text = "Start Auto-Buy"
ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
end
end)
local UserInputService = game:GetService("UserInputService")
local dragging, dragInput, dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
MainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
TitleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = MainFrame.Position
local connection
connection = input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
connection:Disconnect()
end
end)
end
end)
TitleBar.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent and input.KeyCode == Enum.KeyCode.NumpadOne then
MainFrame.Visible = not MainFrame.Visible
end
end)
CloseButton.MouseButton1Click:Connect(function()
autoBuyActive = false
scriptAlive = false
ScreenGui:Destroy()
end)Automatically buy and upgrade everything in Block Tycoon with this smooth AutoBuy script. Progress faster, expand your tycoon instantly, and remove the need for manual grinding. Lightweight, keyless, and works on both mobile and PC.
No comments yet. Be the first to comment!
1local oldUi = game:GetService("CoreGui"):FindFirstChild("BlockTycoonPayloadUI") or
2 game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("BlockTycoonPayloadUI")
3if oldUi then
4 oldUi:Destroy()
5end
6
7local ScreenGui = Instance.new("ScreenGui")
8ScreenGui.Name = "BlockTycoonPayloadUI"
9ScreenGui.ResetOnSpawn = false
10ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
11
12local success, coreGui = pcall(function() return game:GetService("CoreGui") end)
13ScreenGui.Parent = success and coreGui or game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
14
15local MainFrame = Instance.new("Frame")
16MainFrame.Name = "MainFrame"
17MainFrame.Size = UDim2.new(0, 380, 0, 420)
18MainFrame.Position = UDim2.new(0.5, -190, 0.4, -210)
19MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
20MainFrame.BorderSizePixel = 0
21MainFrame.Active = true
22MainFrame.Parent = ScreenGui
23
24local FrameCorner = Instance.new("UICorner")
25FrameCorner.CornerRadius = UDim.new(0, 8)
26FrameCorner.Parent = MainFrame
27
28local FrameStroke = Instance.new("UIStroke")
29FrameStroke.Color = Color3.fromRGB(50, 50, 60)
30FrameStroke.Thickness = 1
31FrameStroke.Parent = MainFrame
32
33local TitleBar = Instance.new("Frame")
34TitleBar.Name = "TitleBar"
35TitleBar.Size = UDim2.new(1, 0, 0, 40)
36TitleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
37TitleBar.BorderSizePixel = 0
38TitleBar.Parent = MainFrame
39
40local TitleCorner = Instance.new("UICorner")
41TitleCorner.CornerRadius = UDim.new(0, 8)
42TitleCorner.Parent = TitleBar
43
44local TitleText = Instance.new("TextLabel")
45TitleText.Size = UDim2.new(1, -90, 1, 0)
46TitleText.Position = UDim2.new(0, 15, 0, 0)
47TitleText.BackgroundTransparency = 1
48TitleText.Text = "Bulk Payload Auto-Buyer [Numpad1]"
49TitleText.TextColor3 = Color3.fromRGB(240, 240, 240)
50TitleText.TextSize = 14
51TitleText.Font = Enum.Font.GothamBold
52TitleText.TextXAlignment = Enum.TextXAlignment.Left
53TitleText.Parent = TitleBar
54
55local CloseButton = Instance.new("TextButton")
56CloseButton.Name = "CloseButton"
57CloseButton.Size = UDim2.new(0, 30, 0, 30)
58CloseButton.Position = UDim2.new(1, -35, 0, 5)
59CloseButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
60CloseButton.Text = "X"
61CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
62CloseButton.TextSize = 14
63CloseButton.Font = Enum.Font.GothamBold
64CloseButton.Parent = TitleBar
65
66local CloseCorner = Instance.new("UICorner")
67CloseCorner.CornerRadius = UDim.new(0, 6)
68CloseCorner.Parent = CloseButton
69
70local ContentFrame = Instance.new("Frame")
71ContentFrame.Name = "ContentFrame"
72ContentFrame.Size = UDim2.new(1, -24, 1, -55)
73ContentFrame.Position = UDim2.new(0, 12, 0, 45)
74ContentFrame.BackgroundTransparency = 1
75ContentFrame.Parent = MainFrame
76
77local DropdownButton = Instance.new("TextButton")
78DropdownButton.Name = "DropdownButton"
79DropdownButton.Size = UDim2.new(1, 0, 0, 38)
80DropdownButton.Position = UDim2.new(0, 0, 0, 10)
81DropdownButton.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
82DropdownButton.Text = "Select Item â–¼"
83DropdownButton.TextColor3 = Color3.fromRGB(220, 220, 220)
84DropdownButton.TextSize = 14
85DropdownButton.Font = Enum.Font.GothamSemibold
86DropdownButton.Parent = ContentFrame
87
88local DropdownCorner = Instance.new("UICorner")
89DropdownCorner.CornerRadius = UDim.new(0, 6)
90DropdownCorner.Parent = DropdownButton
91
92local DropdownContainer = Instance.new("Frame")
93DropdownContainer.Name = "DropdownContainer"
94DropdownContainer.Size = UDim2.new(1, 0, 0, 180)
95DropdownContainer.Position = UDim2.new(0, 0, 0, 52)
96DropdownContainer.BackgroundTransparency = 1
97DropdownContainer.Visible = false
98DropdownContainer.ZIndex = 5
99DropdownContainer.Parent = ContentFrame
100
101local SearchInput = Instance.new("TextBox")
102SearchInput.Name = "SearchInput"
103SearchInput.Size = UDim2.new(1, 0, 0, 32)
104SearchInput.Position = UDim2.new(0, 0, 0, 0)
105SearchInput.BackgroundColor3 = Color3.fromRGB(35, 35, 45)
106SearchInput.PlaceholderText = "🔠Search blocks..."
107SearchInput.PlaceholderColor3 = Color3.fromRGB(120, 120, 130)
108SearchInput.Text = ""
109SearchInput.TextColor3 = Color3.fromRGB(255, 255, 255)
110SearchInput.TextSize = 13
111SearchInput.Font = Enum.Font.Gotham
112SearchInput.ZIndex = 6
113SearchInput.Parent = DropdownContainer
114
115local SearchCorner = Instance.new("UICorner")
116SearchCorner.CornerRadius = UDim.new(0, 4)
117SearchCorner.Parent = SearchInput
118
119local SearchStroke = Instance.new("UIStroke")
120SearchStroke.Color = Color3.fromRGB(60, 60, 75)
121SearchStroke.Thickness = 1
122SearchStroke.Parent = SearchInput
123
124local DropdownList = Instance.new("ScrollingFrame")
125DropdownList.Name = "DropdownList"
126DropdownList.Size = UDim2.new(1, 0, 1, -38)
127DropdownList.Position = UDim2.new(0, 0, 0, 38)
128DropdownList.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
129DropdownList.BorderSizePixel = 0
130DropdownList.ZIndex = 5
131DropdownList.CanvasSize = UDim2.new(0, 0, 0, 0)
132DropdownList.ScrollBarThickness = 6
133DropdownList.Parent = DropdownContainer
134
135local ListLayout = Instance.new("UIListLayout")
136ListLayout.Padding = UDim.new(0, 2)
137ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
138ListLayout.Parent = DropdownList
139
140local AmountLabel = Instance.new("TextLabel")
141AmountLabel.Size = UDim2.new(0.5, -5, 0, 25)
142AmountLabel.Position = UDim2.new(0, 0, 0, 245)
143AmountLabel.BackgroundTransparency = 1
144AmountLabel.Text = "Index Quantity Amount:"
145AmountLabel.TextColor3 = Color3.fromRGB(180, 180, 190)
146AmountLabel.TextSize = 12
147AmountLabel.Font = Enum.Font.GothamSemibold
148AmountLabel.TextXAlignment = Enum.TextXAlignment.Left
149AmountLabel.Parent = ContentFrame
150
151local AmountInput = Instance.new("TextBox")
152AmountInput.Size = UDim2.new(0.5, -5, 0, 32)
153AmountInput.Position = UDim2.new(0, 0, 0, 270)
154AmountInput.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
155AmountInput.Text = "2"
156AmountInput.TextColor3 = Color3.fromRGB(255, 255, 255)
157AmountInput.TextSize = 14
158AmountInput.Font = Enum.Font.Gotham
159AmountInput.Parent = ContentFrame
160
161local AmountCorner = Instance.new("UICorner")
162AmountCorner.CornerRadius = UDim.new(0, 4)
163AmountCorner.Parent = AmountInput
164
165local SpeedLabel = Instance.new("TextLabel")
166SpeedLabel.Size = UDim2.new(0.5, -5, 0, 25)
167SpeedLabel.Position = UDim2.new(0.5, 5, 0, 245)
168SpeedLabel.BackgroundTransparency = 1
169SpeedLabel.Text = "Execution Delay (Sec):"
170SpeedLabel.TextColor3 = Color3.fromRGB(180, 180, 190)
171SpeedLabel.TextSize = 12
172SpeedLabel.Font = Enum.Font.GothamSemibold
173SpeedLabel.TextXAlignment = Enum.TextXAlignment.Left
174SpeedLabel.Parent = ContentFrame
175
176local SpeedInput = Instance.new("TextBox")
177SpeedInput.Size = UDim2.new(0.5, -5, 0, 32)
178SpeedInput.Position = UDim2.new(0.5, 5, 0, 270)
179SpeedInput.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
180SpeedInput.Text = "0.2"
181SpeedInput.TextColor3 = Color3.fromRGB(255, 255, 255)
182SpeedInput.TextSize = 14
183SpeedInput.Font = Enum.Font.Gotham
184SpeedInput.Parent = ContentFrame
185
186local SpeedCorner = Instance.new("UICorner")
187SpeedCorner.CornerRadius = UDim.new(0, 4)
188SpeedCorner.Parent = SpeedInput
189
190local ToggleButton = Instance.new("TextButton")
191ToggleButton.Name = "ToggleButton"
192ToggleButton.Size = UDim2.new(1, 0, 0, 42)
193ToggleButton.Position = UDim2.new(0, 0, 1, -45)
194ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
195ToggleButton.Text = "Start Auto-Buy"
196ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
197ToggleButton.TextSize = 15
198ToggleButton.Font = Enum.Font.GothamBold
199ToggleButton.Parent = ContentFrame
200
201local ToggleCorner = Instance.new("UICorner")
202ToggleCorner.CornerRadius = UDim.new(0, 6)
203ToggleCorner.Parent = ToggleButton
204
205local replicatedStorage = game:GetService("ReplicatedStorage")
206local shopRemote = replicatedStorage:WaitForChild("ShopE")
207local blocksFolder = replicatedStorage:WaitForChild("Blocks")
208
209local selectedItem = nil
210local autoBuyActive = false
211local scriptAlive = true
212local configQuantity = 2
213local configDelay = 0.2
214
215local function populateDropdown()
216 for _, block in pairs(blocksFolder:GetChildren()) do
217 local itemBtn = Instance.new("TextButton")
218 itemBtn.Name = block.Name
219 itemBtn.Size = UDim2.new(1, -8, 0, 30)
220 itemBtn.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
221 itemBtn.Text = block.Name
222 itemBtn.TextColor3 = Color3.fromRGB(200, 200, 200)
223 itemBtn.TextSize = 13
224 itemBtn.Font = Enum.Font.Gotham
225 itemBtn.ZIndex = 6
226 itemBtn.Parent = DropdownList
227
228 local itemCorner = Instance.new("UICorner")
229 itemCorner.CornerRadius = UDim.new(0, 4)
230 itemCorner.Parent = itemBtn
231
232 itemBtn.MouseButton1Click:Connect(function()
233 selectedItem = block.Name
234 DropdownButton.Text = selectedItem .. " â–¼"
235 DropdownContainer.Visible = false
236 SearchInput.Text = ""
237 end)
238 end
239 DropdownList.CanvasSize = UDim2.new(0, 0, 0, ListLayout.AbsoluteContentSize.Y)
240end
241populateDropdown()
242
243SearchInput:GetPropertyChangedSignal("Text"):Connect(function()
244 local searchPattern = string.lower(SearchInput.Text)
245 for _, button in pairs(DropdownList:GetChildren()) do
246 if button:IsA("TextButton") then
247 if searchPattern == "" or string.find(string.lower(button.Name), searchPattern) then
248 button.Visible = true
249 else
250 button.Visible = false
251 end
252 end
253 end
254 DropdownList.CanvasSize = UDim2.new(0, 0, 0, ListLayout.AbsoluteContentSize.Y)
255end)
256
257DropdownButton.MouseButton1Click:Connect(function()
258 DropdownContainer.Visible = not DropdownContainer.Visible
259 if DropdownContainer.Visible then
260 SearchInput:CaptureFocus()
261 end
262end)
263
264AmountInput.FocusLost:Connect(function()
265 local val = tonumber(AmountInput.Text)
266 if val and val > 0 then configQuantity = math.floor(val) else AmountInput.Text = tostring(configQuantity) end
267end)
268
269SpeedInput.FocusLost:Connect(function()
270 local val = tonumber(SpeedInput.Text)
271 if val and val >= 0 then configDelay = val else SpeedInput.Text = tostring(configDelay) end
272end)
273
274task.spawn(function()
275 while scriptAlive do
276 if autoBuyActive and selectedItem then
277 local ohNumber1 = 1
278 local ohTable2 = {
279 [1] = selectedItem,
280 [2] = configQuantity
281 }
282 shopRemote:FireServer(ohNumber1, ohTable2)
283 end
284 task.wait(configDelay)
285 end
286end)
287
288ToggleButton.MouseButton1Click:Connect(function()
289 if not selectedItem then
290 DropdownButton.Text = "CHOOSE AN ITEM FIRST!"
291 task.delay(1.5, function() DropdownButton.Text = "Select Item â–¼" end)
292 return
293 end
294
295 autoBuyActive = not autoBuyActive
296
297 if autoBuyActive then
298 configQuantity = tonumber(AmountInput.Text) or 2
299 configDelay = tonumber(SpeedInput.Text) or 0.2
300 ToggleButton.Text = "Stop Auto-Buy"
301 ToggleButton.BackgroundColor3 = Color3.fromRGB(150, 50, 50)
302 else
303 ToggleButton.Text = "Start Auto-Buy"
304 ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 150, 50)
305 end
306end)
307
308local UserInputService = game:GetService("UserInputService")
309local dragging, dragInput, dragStart, startPos
310
311local function update(input)
312 local delta = input.Position - dragStart
313 MainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
314end
315
316TitleBar.InputBegan:Connect(function(input)
317 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
318 dragging = true
319 dragStart = input.Position
320 startPos = MainFrame.Position
321
322 local connection
323 connection = input.Changed:Connect(function()
324 if input.UserInputState == Enum.UserInputState.End then
325 dragging = false
326 connection:Disconnect()
327 end
328 end)
329 end
330end)
331
332TitleBar.InputChanged:Connect(function(input)
333 if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
334 dragInput = input
335 end
336end)
337
338UserInputService.InputChanged:Connect(function(input)
339 if input == dragInput and dragging then
340 update(input)
341 end
342end)
343
344UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
345 if not gameProcessedEvent and input.KeyCode == Enum.KeyCode.NumpadOne then
346 MainFrame.Visible = not MainFrame.Visible
347 end
348end)
349
350CloseButton.MouseButton1Click:Connect(function()
351 autoBuyActive = false
352 scriptAlive = false
353 ScreenGui:Destroy()
354end)