
Keyless

-- Food Shop Auto Buy GUI Script
-- Create ScreenGui
local ScreenGui = Instance.new("ScreenGui")
local MainFrame = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local ScrollFrame = Instance.new("ScrollingFrame")
local UIListLayout = Instance.new("UIListLayout")
local BuySelectedButton = Instance.new("TextButton")
local BuyAllButton = Instance.new("TextButton")
local CloseButton = Instance.new("TextButton")
local ToggleButton = Instance.new("TextButton")
-- Parent to CoreGui to prevent game detection
ScreenGui.Parent = game:GetService("CoreGui")
ScreenGui.Name = "FoodShopGUI"
ScreenGui.ResetOnSpawn = false
-- Main Frame
MainFrame.Parent = ScreenGui
MainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
MainFrame.BorderSizePixel = 0
MainFrame.Position = UDim2.new(0.5, -200, 0.5, -250)
MainFrame.Size = UDim2.new(0, 400, 0, 500)
MainFrame.Active = true
MainFrame.Draggable = true
-- Add rounded corners
local Corner = Instance.new("UICorner")
Corner.CornerRadius = UDim.new(0, 10)
Corner.Parent = MainFrame
-- Title
Title.Parent = MainFrame
Title.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
Title.BorderSizePixel = 0
Title.Size = UDim2.new(1, 0, 0, 50)
Title.Font = Enum.Font.GothamBold
Title.Text = "🛒 Food Shop Auto Buy"
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.TextSize = 20
local TitleCorner = Instance.new("UICorner")
TitleCorner.CornerRadius = UDim.new(0, 10)
TitleCorner.Parent = Title
-- Close Button
CloseButton.Parent = MainFrame
CloseButton.BackgroundColor3 = Color3.fromRGB(220, 53, 69)
CloseButton.BorderSizePixel = 0
CloseButton.Position = UDim2.new(1, -45, 0, 5)
CloseButton.Size = UDim2.new(0, 40, 0, 40)
CloseButton.Font = Enum.Font.GothamBold
CloseButton.Text = "X"
CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
CloseButton.TextSize = 18
local CloseCorner = Instance.new("UICorner")
CloseCorner.CornerRadius = UDim.new(0, 8)
CloseCorner.Parent = CloseButton
-- Scroll Frame
ScrollFrame.Parent = MainFrame
ScrollFrame.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
ScrollFrame.BorderSizePixel = 0
ScrollFrame.Position = UDim2.new(0, 10, 0, 60)
ScrollFrame.Size = UDim2.new(1, -20, 1, -225)
ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
ScrollFrame.ScrollBarThickness = 6
local ScrollCorner = Instance.new("UICorner")
ScrollCorner.CornerRadius = UDim.new(0, 8)
ScrollCorner.Parent = ScrollFrame
-- UIListLayout
UIListLayout.Parent = ScrollFrame
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0, 5)
-- Items list
local items = {
"Wheat", "Corn", "Pumpkin", "Carrot", "Egg",
"Biscuit", "Honey", "Milk", "Fish", "Raw Meat",
"Bamboo", "Cocoa", "Baobab Fruit", "Seaweed", "Frozen Berry"
}
local selectedItems = {}
-- Create checkboxes for each item
for i, itemName in ipairs(items) do
local ItemFrame = Instance.new("Frame")
local Checkbox = Instance.new("TextButton")
local ItemLabel = Instance.new("TextLabel")
ItemFrame.Parent = ScrollFrame
ItemFrame.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
ItemFrame.BorderSizePixel = 0
ItemFrame.Size = UDim2.new(1, -10, 0, 35)
local ItemCorner = Instance.new("UICorner")
ItemCorner.CornerRadius = UDim.new(0, 6)
ItemCorner.Parent = ItemFrame
Checkbox.Parent = ItemFrame
Checkbox.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
Checkbox.BorderSizePixel = 0
Checkbox.Position = UDim2.new(0, 5, 0.5, -12)
Checkbox.Size = UDim2.new(0, 24, 0, 24)
Checkbox.Font = Enum.Font.GothamBold
Checkbox.Text = ""
Checkbox.TextColor3 = Color3.fromRGB(255, 255, 255)
Checkbox.TextSize = 16
local CheckCorner = Instance.new("UICorner")
CheckCorner.CornerRadius = UDim.new(0, 4)
CheckCorner.Parent = Checkbox
ItemLabel.Parent = ItemFrame
ItemLabel.BackgroundTransparency = 1
ItemLabel.Position = UDim2.new(0, 35, 0, 0)
ItemLabel.Size = UDim2.new(1, -40, 1, 0)
ItemLabel.Font = Enum.Font.Gotham
ItemLabel.Text = itemName
ItemLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
ItemLabel.TextSize = 14
ItemLabel.TextXAlignment = Enum.TextXAlignment.Left
selectedItems[itemName] = false
Checkbox.MouseButton1Click:Connect(function()
selectedItems[itemName] = not selectedItems[itemName]
if selectedItems[itemName] then
Checkbox.BackgroundColor3 = Color3.fromRGB(40, 167, 69)
Checkbox.Text = "✓"
else
Checkbox.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
Checkbox.Text = ""
end
end)
end
-- Update canvas size
UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y + 10)
end)
-- Buy Selected Button
BuySelectedButton.Parent = MainFrame
BuySelectedButton.BackgroundColor3 = Color3.fromRGB(0, 123, 255)
BuySelectedButton.BorderSizePixel = 0
BuySelectedButton.Position = UDim2.new(0, 10, 1, -75)
BuySelectedButton.Size = UDim2.new(0.48, -5, 0, 35)
BuySelectedButton.Font = Enum.Font.GothamBold
BuySelectedButton.Text = "Buy Selected"
BuySelectedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
BuySelectedButton.TextSize = 14
local BuySelectedCorner = Instance.new("UICorner")
BuySelectedCorner.CornerRadius = UDim.new(0, 8)
BuySelectedCorner.Parent = BuySelectedButton
-- Buy All Button
BuyAllButton.Parent = MainFrame
BuyAllButton.BackgroundColor3 = Color3.fromRGB(40, 167, 69)
BuyAllButton.BorderSizePixel = 0
BuyAllButton.Position = UDim2.new(0.52, 5, 1, -75)
BuyAllButton.Size = UDim2.new(0.48, -15, 0, 35)
BuyAllButton.Font = Enum.Font.GothamBold
BuyAllButton.Text = "Buy All"
BuyAllButton.TextColor3 = Color3.fromRGB(255, 255, 255)
BuyAllButton.TextSize = 14
local BuyAllCorner = Instance.new("UICorner")
BuyAllCorner.CornerRadius = UDim.new(0, 8)
BuyAllCorner.Parent = BuyAllButton
-- Auto Buy Toggle Button
local AutoBuyButton = Instance.new("TextButton")
AutoBuyButton.Parent = MainFrame
AutoBuyButton.BackgroundColor3 = Color3.fromRGB(108, 117, 125)
AutoBuyButton.BorderSizePixel = 0
AutoBuyButton.Position = UDim2.new(0, 10, 1, -110)
AutoBuyButton.Size = UDim2.new(1, -20, 0, 30)
AutoBuyButton.Font = Enum.Font.GothamBold
AutoBuyButton.Text = "Auto Buy: OFF"
AutoBuyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
AutoBuyButton.TextSize = 14
local AutoBuyCorner = Instance.new("UICorner")
AutoBuyCorner.CornerRadius = UDim.new(0, 8)
AutoBuyCorner.Parent = AutoBuyButton
-- Auto Buy Interval Input
local IntervalFrame = Instance.new("Frame")
IntervalFrame.Parent = MainFrame
IntervalFrame.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
IntervalFrame.BorderSizePixel = 0
IntervalFrame.Position = UDim2.new(0, 10, 1, -145)
IntervalFrame.Size = UDim2.new(1, -20, 0, 30)
local IntervalCorner = Instance.new("UICorner")
IntervalCorner.CornerRadius = UDim.new(0, 8)
IntervalCorner.Parent = IntervalFrame
local IntervalLabel = Instance.new("TextLabel")
IntervalLabel.Parent = IntervalFrame
IntervalLabel.BackgroundTransparency = 1
IntervalLabel.Position = UDim2.new(0, 10, 0, 0)
IntervalLabel.Size = UDim2.new(0, 120, 1, 0)
IntervalLabel.Font = Enum.Font.Gotham
IntervalLabel.Text = "Interval (seconds):"
IntervalLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
IntervalLabel.TextSize = 12
IntervalLabel.TextXAlignment = Enum.TextXAlignment.Left
local IntervalInput = Instance.new("TextBox")
IntervalInput.Parent = IntervalFrame
IntervalInput.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
IntervalInput.BorderSizePixel = 0
IntervalInput.Position = UDim2.new(0, 140, 0.5, -10)
IntervalInput.Size = UDim2.new(1, -150, 0, 20)
IntervalInput.Font = Enum.Font.Gotham
IntervalInput.PlaceholderText = "10"
IntervalInput.Text = "10"
IntervalInput.TextColor3 = Color3.fromRGB(255, 255, 255)
IntervalInput.TextSize = 12
IntervalInput.ClearTextOnFocus = false
local InputCorner = Instance.new("UICorner")
InputCorner.CornerRadius = UDim.new(0, 4)
InputCorner.Parent = IntervalInput
-- Status Label
local StatusLabel = Instance.new("TextLabel")
StatusLabel.Parent = MainFrame
StatusLabel.BackgroundTransparency = 1
StatusLabel.Position = UDim2.new(0, 10, 1, -35)
StatusLabel.Size = UDim2.new(1, -20, 0, 25)
StatusLabel.Font = Enum.Font.Gotham
StatusLabel.Text = "Ready"
StatusLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
StatusLabel.TextSize = 12
-- Toggle Button (minimize/maximize)
ToggleButton.Parent = ScreenGui
ToggleButton.BackgroundColor3 = Color3.fromRGB(0, 123, 255)
ToggleButton.BorderSizePixel = 0
ToggleButton.Position = UDim2.new(0, 10, 0.5, -25)
ToggleButton.Size = UDim2.new(0, 50, 0, 50)
ToggleButton.Font = Enum.Font.GothamBold
ToggleButton.Text = "🛒"
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.TextSize = 24
ToggleButton.Visible = false
local ToggleCorner = Instance.new("UICorner")
ToggleCorner.CornerRadius = UDim.new(0, 10)
ToggleCorner.Parent = ToggleButton
-- Functions
local autoBuyEnabled = false
local autoBuyLoop = nil
local function updateStatus(message, color)
StatusLabel.Text = message
StatusLabel.TextColor3 = color or Color3.fromRGB(200, 200, 200)
end
local function buyItems(itemList)
local count = 0
for _, itemName in ipairs(itemList) do
local success, err = pcall(function()
local args = {
[1] = "Food",
[2] = {
["BuyAll"] = true,
["ItemName"] = itemName
}
}
game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Shop"):WaitForChild("Buy"):FireServer(unpack(args))
count = count + 1
updateStatus("Buying: " .. itemName .. " (" .. count .. "/" .. #itemList .. ")", Color3.fromRGB(255, 193, 7))
end)
if not success then
updateStatus("Error buying: " .. itemName, Color3.fromRGB(220, 53, 69))
warn("Error:", err)
end
wait(0.1)
end
updateStatus("Purchased " .. count .. " items!", Color3.fromRGB(40, 167, 69))
if not autoBuyEnabled then
wait(2)
updateStatus("Ready", Color3.fromRGB(200, 200, 200))
end
end
local function startAutoBuy()
autoBuyEnabled = true
AutoBuyButton.Text = "Auto Buy: ON"
AutoBuyButton.BackgroundColor3 = Color3.fromRGB(40, 167, 69)
autoBuyLoop = coroutine.create(function()
while autoBuyEnabled do
local itemsToBuy = {}
for itemName, isSelected in pairs(selectedItems) do
if isSelected then
table.insert(itemsToBuy, itemName)
end
end
if #itemsToBuy > 0 then
buyItems(itemsToBuy)
else
buyItems(items) -- Buy all if nothing selected
end
local interval = tonumber(IntervalInput.Text) or 10
for i = interval, 1, -1 do
if not autoBuyEnabled then break end
updateStatus("Next auto buy in: " .. i .. "s", Color3.fromRGB(0, 123, 255))
wait(1)
end
end
end)
coroutine.resume(autoBuyLoop)
end
local function stopAutoBuy()
autoBuyEnabled = false
AutoBuyButton.Text = "Auto Buy: OFF"
AutoBuyButton.BackgroundColor3 = Color3.fromRGB(108, 117, 125)
updateStatus("Auto buy stopped", Color3.fromRGB(200, 200, 200))
wait(2)
updateStatus("Ready", Color3.fromRGB(200, 200, 200))
end
-- Button Events
AutoBuyButton.MouseButton1Click:Connect(function()
if autoBuyEnabled then
stopAutoBuy()
else
startAutoBuy()
end
end)
BuySelectedButton.MouseButton1Click:Connect(function()
if autoBuyEnabled then
updateStatus("Please turn off Auto Buy first!", Color3.fromRGB(220, 53, 69))
wait(2)
updateStatus("Next auto buy in: ...", Color3.fromRGB(0, 123, 255))
return
end
local itemsToBuy = {}
for itemName, isSelected in pairs(selectedItems) do
if isSelected then
table.insert(itemsToBuy, itemName)
end
end
if #itemsToBuy == 0 then
updateStatus("No items selected!", Color3.fromRGB(220, 53, 69))
wait(2)
updateStatus("Ready", Color3.fromRGB(200, 200, 200))
return
end
buyItems(itemsToBuy)
end)
BuyAllButton.MouseButton1Click:Connect(function()
if autoBuyEnabled then
updateStatus("Please turn off Auto Buy first!", Color3.fromRGB(220, 53, 69))
wait(2)
updateStatus("Next auto buy in: ...", Color3.fromRGB(0, 123, 255))
return
end
updateStatus("Buying all items...", Color3.fromRGB(255, 193, 7))
buyItems(items)
end)
CloseButton.MouseButton1Click:Connect(function()
MainFrame.Visible = false
ToggleButton.Visible = true
end)
ToggleButton.MouseButton1Click:Connect(function()
MainFrame.Visible = true
ToggleButton.Visible = false
end)
-- Notification
updateStatus("GUI Loaded! Select items and click Buy", Color3.fromRGB(40, 167, 69))
wait(3)
updateStatus("Ready", Color3.fromRGB(200, 200, 200))
Made by Ai🤣