local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local CoreGui = game:GetService("CoreGui")
local player = Players.LocalPlayer
-- == Configuration & States ==
local Toggles = {
AutoCook = false,
AutoPlate = false,
AutoSell = false,
AutoBuy = false,
AutoBuyTotem = false
}
local MeatOptions = {
"Raw Hotdog", "Raw Burger", "Raw Chicken", "Raw Salmon",
"Raw Ribs", "Raw Prime Rib", "Raw Brisket", "Raw Lobtser Tail", "Raw Lobster Tail",
"Raw Bigfoot Filet", "Raw Dragon", "Raw Demon", "Raw Whole Unicorn"
}
local TotemOptions = {
"Gold Totem", "Salt and Pepper Totem", "Totem of Small Growth",
"Totem of Growth", "Totem of Great Growth", "Speed Totem",
"Luck Totem", "Diamond Totem", "Ruby Totem"
}
-- Dynamically fetch all meats & totems from the game
pcall(function()
if ReplicatedStorage:FindFirstChild("Meats") then
for _, rarity in ipairs(ReplicatedStorage.Meats:GetChildren()) do
for _, tool in ipairs(rarity:GetChildren()) do
if tool:IsA("Tool") and not table.find(MeatOptions, tool.Name) then
table.insert(MeatOptions, tool.Name)
end
end
end
end
if ReplicatedStorage:FindFirstChild("Totems") then
for _, t in ipairs(ReplicatedStorage.Totems:GetChildren()) do
if not table.find(TotemOptions, t.Name) then table.insert(TotemOptions, t.Name) end
end
end
end)
local BuyTargets = {MeatOptions[1]}
local BuyTotemTargets = {}
local BuyThreshold = 5
local ActionDelay = 0.3
local MeatStates = {}
-- Track meat states perfectly using the exact RemoteEvent
ReplicatedStorage.Remotes.CookUpdate.OnClientEvent:Connect(function(spot, meatName, timeVal, state)
if spot and typeof(spot) == "Instance" then
MeatStates[spot] = state
end
end)
-- Handle Auto Sell (Accepts NPC Offers instantly)
ReplicatedStorage.Remotes.NPCOffer.OnClientEvent:Connect(function(npc, price, meatName, offerId)
if Toggles.AutoSell then
task.wait(math.random(3, 6) / 10)
ReplicatedStorage.Remotes.NPCResponse:FireServer(offerId, true)
end
end)
-- == Core Helper Functions ==
local function isSpotEmpty(spot)
for _, child in ipairs(spot:GetChildren()) do
if child:IsA("Model") or child:IsA("BasePart") or child:IsA("UnionOperation") or child:GetAttribute("MeatName") ~= nil then return false end
if child:IsA("ProximityPrompt") then
local actionText = string.lower(child.ActionText)
if string.find(actionText, "pick up") or string.find(actionText, "take") then return false end
end
end
local prompt = spot:FindFirstChildOfClass("ProximityPrompt")
if prompt then
local actionText = string.lower(prompt.ActionText)
if string.find(actionText, "pick up") or string.find(actionText, "take") then return false end
end
return true
end
local function getAndEquipMeat(typeFilter)
local char = player.Character
local hum = char and char:FindFirstChildOfClass("Humanoid")
local backpack = player:FindFirstChild("Backpack")
if not hum or not backpack then return nil end
local function isCorrectMeat(tool)
if not tool:IsA("Tool") then return false end
local name = string.lower(tool.Name)
if string.find(name, "hammer") or string.find(name, "table") or string.find(name, "chair") or string.find(name, "oven") or string.find(name, "tent") then return false end
if string.find(name, "grill") and not string.find(name, "grilled") then return false end
local isCooked = string.find(name, "%[") or string.find(name, "perfect") or string.find(name, "overcooked") or string.find(name, "cooked")
local isRaw = string.find(name, "raw ")
if typeFilter == "Raw" and isRaw and not isCooked then return true
elseif typeFilter == "Cooked" and isCooked then return true end
return false
end
for _, t in ipairs(char:GetChildren()) do if isCorrectMeat(t) then return t end end
for _, t in ipairs(backpack:GetChildren()) do
if isCorrectMeat(t) then
hum:EquipTool(t)
task.wait(0.1)
return t
end
end
return nil
end
local function countMeatStock(targetName)
local count = 0
local tLower = string.lower(targetName)
local function scan(folder)
for _, item in ipairs(folder:GetChildren()) do
if item:IsA("Tool") and string.find(string.lower(item.Name), tLower) then
local match = string.match(item.Name, "%(x(%d+)%)")
if match then count = count + tonumber(match) else count = count + 1 end
end
end
end
if player.Character then scan(player.Character) end
if player:FindFirstChild("Backpack") then scan(player:FindFirstChild("Backpack")) end
return count
end
local function getCleanName(toolName)
local clean = string.gsub(toolName, "%s*%(x%d+%)", "")
return string.match(clean, "^%s*(.-)%s*$") or clean
end
-- == Main Automation Loop (Cooking/Plating) ==
task.spawn(function()
while task.wait(ActionDelay) do
local myLot = workspace:WaitForChild("PlayerLots"):FindFirstChild(player.Name)
if not myLot then continue end
-- Auto Cook
if Toggles.AutoCook then
for _, furniture in ipairs(myLot:GetChildren()) do
local grills = furniture:FindFirstChild("GrillSpots")
if grills then
for _, spot in ipairs(grills:GetChildren()) do
if isSpotEmpty(spot) then
local rawMeat = getAndEquipMeat("Raw")
if rawMeat then
ReplicatedStorage.Remotes.PlaceMeat:FireServer(spot, getCleanName(rawMeat.Name))
task.wait(ActionDelay)
end
else
local state = MeatStates[spot]
if not state then
local meatPart = spot:FindFirstChildWhichIsA("BasePart") or spot:FindFirstChildWhichIsA("UnionOperation")
if meatPart then
local bb = meatPart:FindFirstChild("CookBillboard")
if bb and bb:FindFirstChild("BG") and bb.BG:FindFirstChild("StateLabel") then state = bb.BG.StateLabel.Text end
end
end
if state == "Perfect" then
ReplicatedStorage.Remotes.PickupMeat:FireServer(spot)
MeatStates[spot] = nil
task.wait(ActionDelay)
end
end
end
end
end
end
-- Auto Plate
if Toggles.AutoPlate then
for _, furniture in ipairs(myLot:GetChildren()) do
local plates = furniture:FindFirstChild("Plates")
if plates then
for _, plate in ipairs(plates:GetChildren()) do
if isSpotEmpty(plate) then
local cookedMeat = getAndEquipMeat("Cooked")
if cookedMeat then
ReplicatedStorage.Remotes.PlaceMeat:FireServer(plate, getCleanName(cookedMeat.Name))
task.wait(ActionDelay)
end
end
end
end
end
end
end
end)
-- == Secondary Loop (Shop Buying) ==
task.spawn(function()
while task.wait(1.5) do
-- Buy Meat
if Toggles.AutoBuy and #BuyTargets > 0 then
for _, targetMeat in ipairs(BuyTargets) do
if countMeatStock(targetMeat) < BuyThreshold then
ReplicatedStorage.Remotes.BuyMeat:FireServer(targetMeat, false)
task.wait(0.3)
end
end
end
-- Buy Totems
if Toggles.AutoBuyTotem and #BuyTotemTargets > 0 then
for _, targetTotem in ipairs(BuyTotemTargets) do
-- Buys totem using Cash (false) instead of Robux
ReplicatedStorage.Remotes.BuyShopItem:FireServer(targetTotem, false)
task.wait(0.3)
end
end
end
end)
-- == GUI CONSTRUCTION ==
local sg = Instance.new("ScreenGui")
sg.Name = "BBQMastery"
sg.ResetOnSpawn = false
pcall(function() sg.Parent = CoreGui end)
if not sg.Parent then sg.Parent = player:WaitForChild("PlayerGui") end
for _, child in ipairs(sg.Parent:GetChildren()) do
if child.Name == "BBQMastery" and child ~= sg then child:Destroy() end
end
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 270, 0, 360)
frame.Position = UDim2.new(0.5, -135, 0.5, -180)
frame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
frame.BorderSizePixel = 0
frame.Active = true
frame.Draggable = true
frame.Parent = sg
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 10)
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, 0, 0, 35)
title.BackgroundTransparency = 1
title.Text = "🖠BBQ MASTERY"
title.TextColor3 = Color3.fromRGB(255, 120, 50)
title.Font = Enum.Font.GothamBold
title.TextSize = 18
title.Parent = frame
local closeBtn = Instance.new("TextButton")
closeBtn.Size = UDim2.new(0, 30, 0, 30)
closeBtn.Position = UDim2.new(1, -35, 0, 2)
closeBtn.BackgroundTransparency = 1
closeBtn.Text = "X"
closeBtn.TextColor3 = Color3.fromRGB(255, 80, 80)
closeBtn.Font = Enum.Font.GothamBold
closeBtn.TextSize = 16
closeBtn.Parent = frame
closeBtn.MouseButton1Click:Connect(function() sg:Destroy() end)
-- Tabs Container
local tabFrame = Instance.new("Frame")
tabFrame.Size = UDim2.new(1, 0, 0, 30)
tabFrame.Position = UDim2.new(0, 0, 0, 35)
tabFrame.BackgroundTransparency = 1
tabFrame.Parent = frame
local pageMeat = Instance.new("Frame")
pageMeat.Size = UDim2.new(1, 0, 1, -65)
pageMeat.Position = UDim2.new(0, 0, 0, 65)
pageMeat.BackgroundTransparency = 1
pageMeat.Parent = frame
local pageTotems = Instance.new("Frame")
pageTotems.Size = UDim2.new(1, 0, 1, -65)
pageTotems.Position = UDim2.new(0, 0, 0, 65)
pageTotems.BackgroundTransparency = 1
pageTotems.Visible = false
pageTotems.Parent = frame
local function createTabButton(text, xPos, targetPage, isDefault)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(0.45, 0, 1, 0)
btn.Position = UDim2.new(xPos, 0, 0, 0)
btn.BackgroundColor3 = isDefault and Color3.fromRGB(255, 120, 50) or Color3.fromRGB(40, 40, 45)
btn.Text = text
btn.TextColor3 = isDefault and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
btn.Font = Enum.Font.GothamBold
btn.TextSize = 12
Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
btn.Parent = tabFrame
return btn
end
local btnTabMeat = createTabButton("🖠BBQ", 0.035, pageMeat, true)
local btnTabTotem = createTabButton("🗿 TOTEMS", 0.515, pageTotems, false)
btnTabMeat.MouseButton1Click:Connect(function()
pageMeat.Visible = true; pageTotems.Visible = false
btnTabMeat.BackgroundColor3 = Color3.fromRGB(255, 120, 50); btnTabMeat.TextColor3 = Color3.fromRGB(255, 255, 255)
btnTabTotem.BackgroundColor3 = Color3.fromRGB(40, 40, 45); btnTabTotem.TextColor3 = Color3.fromRGB(180, 180, 180)
end)
btnTabTotem.MouseButton1Click:Connect(function()
pageTotems.Visible = true; pageMeat.Visible = false
btnTabTotem.BackgroundColor3 = Color3.fromRGB(255, 120, 50); btnTabTotem.TextColor3 = Color3.fromRGB(255, 255, 255)
btnTabMeat.BackgroundColor3 = Color3.fromRGB(40, 40, 45); btnTabMeat.TextColor3 = Color3.fromRGB(180, 180, 180)
end)
-- Element Generators
local function createToggle(parent, name, yPos, varName)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(0.85, 0, 0, 35)
btn.Position = UDim2.new(0.075, 0, 0, yPos)
btn.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
btn.Text = name .. " [OFF]"
btn.TextColor3 = Color3.fromRGB(200, 200, 200)
btn.Font = Enum.Font.GothamBold
btn.TextSize = 14
Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
btn.Parent = parent
btn.MouseButton1Click:Connect(function()
Toggles[varName] = not Toggles[varName]
if Toggles[varName] then
btn.BackgroundColor3 = Color3.fromRGB(255, 120, 50)
btn.Text = name .. " [ON]"
btn.TextColor3 = Color3.fromRGB(255, 255, 255)
else
btn.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
btn.Text = name .. " [OFF]"
btn.TextColor3 = Color3.fromRGB(200, 200, 200)
end
end)
end
local function createDropdown(parent, labelPrefix, yPos, options, targetTable)
local mainBtn = Instance.new("TextButton")
mainBtn.Size = UDim2.new(0.85, 0, 0, 35)
mainBtn.Position = UDim2.new(0.075, 0, 0, yPos)
mainBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
mainBtn.Text = labelPrefix .. (#targetTable > 0 and string.sub(targetTable[1], 1, 15) or "None")
mainBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
mainBtn.Font = Enum.Font.Gotham
mainBtn.TextSize = 13
mainBtn.ZIndex = 5
Instance.new("UICorner", mainBtn).CornerRadius = UDim.new(0, 6)
Instance.new("UIStroke", mainBtn).Color = Color3.fromRGB(60, 60, 65)
mainBtn.Parent = parent
local list = Instance.new("ScrollingFrame")
list.Size = UDim2.new(0.85, 0, 0, 120)
list.Position = UDim2.new(0.075, 0, 0, yPos + 40)
list.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
list.BorderSizePixel = 0
list.ScrollBarThickness = 4
list.ScrollBarImageColor3 = Color3.fromRGB(255, 120, 50)
list.Visible = false
list.ZIndex = 10
list.CanvasSize = UDim2.new(0, 0, 0, #options * 30)
Instance.new("UICorner", list).CornerRadius = UDim.new(0, 6)
list.Parent = parent
Instance.new("UIListLayout", list)
for i, optName in ipairs(options) do
local optBtn = Instance.new("TextButton")
optBtn.Size = UDim2.new(1, 0, 0, 30)
optBtn.BackgroundColor3 = (i % 2 == 0) and Color3.fromRGB(40, 40, 45) or Color3.fromRGB(35, 35, 40)
optBtn.BorderSizePixel = 0
optBtn.Text = optName
optBtn.TextColor3 = table.find(targetTable, optName) and Color3.fromRGB(100, 255, 100) or Color3.fromRGB(220, 220, 220)
optBtn.Font = Enum.Font.Gotham
optBtn.TextSize = 12
optBtn.ZIndex = 11
optBtn.Parent = list
optBtn.MouseButton1Click:Connect(function()
local idx = table.find(targetTable, optName)
if idx then
table.remove(targetTable, idx)
optBtn.TextColor3 = Color3.fromRGB(220, 220, 220)
else
table.insert(targetTable, optName)
optBtn.TextColor3 = Color3.fromRGB(100, 255, 100)
end
if #targetTable == 0 then mainBtn.Text = labelPrefix .. "None"
elseif #targetTable == 1 then mainBtn.Text = labelPrefix .. string.sub(targetTable[1], 1, 15)
else mainBtn.Text = labelPrefix .. #targetTable .. " Selected" end
end)
end
mainBtn.MouseButton1Click:Connect(function() list.Visible = not list.Visible end)
end
-- Populate Tab 1: Meat
createToggle(pageMeat, "Auto Cook (Perfect)", 10, "AutoCook")
createToggle(pageMeat, "Auto Plate", 55, "AutoPlate")
createToggle(pageMeat, "Auto Sell (NPC)", 100, "AutoSell")
createToggle(pageMeat, "Auto Buy Meat", 145, "AutoBuy")
createDropdown(pageMeat, "Buy Meat: ", 190, MeatOptions, BuyTargets)
-- Populate Tab 2: Totems
createToggle(pageTotems, "Auto Buy Totems", 10, "AutoBuyTotem")
createDropdown(pageTotems, "Buy Totem: ", 55, TotemOptions, BuyTotemTargets)
print("✅ BBQ Mastery v4 (Totems & Tabs) Loaded Successfully!")Simple and efficient autofarm script for BBQ It. Farm resources automatically, speed up progression, and grind without manual effort. Lightweight, open source, and fully keyless for easy use on both mobile and PC.
No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local ReplicatedStorage = game:GetService("ReplicatedStorage")
3local RunService = game:GetService("RunService")
4local CoreGui = game:GetService("CoreGui")
5
6local player = Players.LocalPlayer
7
8-- == Configuration & States ==
9local Toggles = {
10 AutoCook = false,
11 AutoPlate = false,
12 AutoSell = false,
13 AutoBuy = false,
14 AutoBuyTotem = false
15}
16
17local MeatOptions = {
18 "Raw Hotdog", "Raw Burger", "Raw Chicken", "Raw Salmon",
19 "Raw Ribs", "Raw Prime Rib", "Raw Brisket", "Raw Lobtser Tail", "Raw Lobster Tail",
20 "Raw Bigfoot Filet", "Raw Dragon", "Raw Demon", "Raw Whole Unicorn"
21}
22
23local TotemOptions = {
24 "Gold Totem", "Salt and Pepper Totem", "Totem of Small Growth",
25 "Totem of Growth", "Totem of Great Growth", "Speed Totem",
26 "Luck Totem", "Diamond Totem", "Ruby Totem"
27}
28
29-- Dynamically fetch all meats & totems from the game
30pcall(function()
31 if ReplicatedStorage:FindFirstChild("Meats") then
32 for _, rarity in ipairs(ReplicatedStorage.Meats:GetChildren()) do
33 for _, tool in ipairs(rarity:GetChildren()) do
34 if tool:IsA("Tool") and not table.find(MeatOptions, tool.Name) then
35 table.insert(MeatOptions, tool.Name)
36 end
37 end
38 end
39 end
40 if ReplicatedStorage:FindFirstChild("Totems") then
41 for _, t in ipairs(ReplicatedStorage.Totems:GetChildren()) do
42 if not table.find(TotemOptions, t.Name) then table.insert(TotemOptions, t.Name) end
43 end
44 end
45end)
46
47local BuyTargets = {MeatOptions[1]}
48local BuyTotemTargets = {}
49local BuyThreshold = 5
50local ActionDelay = 0.3
51local MeatStates = {}
52
53-- Track meat states perfectly using the exact RemoteEvent
54ReplicatedStorage.Remotes.CookUpdate.OnClientEvent:Connect(function(spot, meatName, timeVal, state)
55 if spot and typeof(spot) == "Instance" then
56 MeatStates[spot] = state
57 end
58end)
59
60-- Handle Auto Sell (Accepts NPC Offers instantly)
61ReplicatedStorage.Remotes.NPCOffer.OnClientEvent:Connect(function(npc, price, meatName, offerId)
62 if Toggles.AutoSell then
63 task.wait(math.random(3, 6) / 10)
64 ReplicatedStorage.Remotes.NPCResponse:FireServer(offerId, true)
65 end
66end)
67
68-- == Core Helper Functions ==
69local function isSpotEmpty(spot)
70 for _, child in ipairs(spot:GetChildren()) do
71 if child:IsA("Model") or child:IsA("BasePart") or child:IsA("UnionOperation") or child:GetAttribute("MeatName") ~= nil then return false end
72 if child:IsA("ProximityPrompt") then
73 local actionText = string.lower(child.ActionText)
74 if string.find(actionText, "pick up") or string.find(actionText, "take") then return false end
75 end
76 end
77 local prompt = spot:FindFirstChildOfClass("ProximityPrompt")
78 if prompt then
79 local actionText = string.lower(prompt.ActionText)
80 if string.find(actionText, "pick up") or string.find(actionText, "take") then return false end
81 end
82 return true
83end
84
85local function getAndEquipMeat(typeFilter)
86 local char = player.Character
87 local hum = char and char:FindFirstChildOfClass("Humanoid")
88 local backpack = player:FindFirstChild("Backpack")
89 if not hum or not backpack then return nil end
90
91 local function isCorrectMeat(tool)
92 if not tool:IsA("Tool") then return false end
93 local name = string.lower(tool.Name)
94
95 if string.find(name, "hammer") or string.find(name, "table") or string.find(name, "chair") or string.find(name, "oven") or string.find(name, "tent") then return false end
96 if string.find(name, "grill") and not string.find(name, "grilled") then return false end
97
98 local isCooked = string.find(name, "%[") or string.find(name, "perfect") or string.find(name, "overcooked") or string.find(name, "cooked")
99 local isRaw = string.find(name, "raw ")
100
101 if typeFilter == "Raw" and isRaw and not isCooked then return true
102 elseif typeFilter == "Cooked" and isCooked then return true end
103 return false
104 end
105
106 for _, t in ipairs(char:GetChildren()) do if isCorrectMeat(t) then return t end end
107 for _, t in ipairs(backpack:GetChildren()) do
108 if isCorrectMeat(t) then
109 hum:EquipTool(t)
110 task.wait(0.1)
111 return t
112 end
113 end
114 return nil
115end
116
117local function countMeatStock(targetName)
118 local count = 0
119 local tLower = string.lower(targetName)
120 local function scan(folder)
121 for _, item in ipairs(folder:GetChildren()) do
122 if item:IsA("Tool") and string.find(string.lower(item.Name), tLower) then
123 local match = string.match(item.Name, "%(x(%d+)%)")
124 if match then count = count + tonumber(match) else count = count + 1 end
125 end
126 end
127 end
128 if player.Character then scan(player.Character) end
129 if player:FindFirstChild("Backpack") then scan(player:FindFirstChild("Backpack")) end
130 return count
131end
132
133local function getCleanName(toolName)
134 local clean = string.gsub(toolName, "%s*%(x%d+%)", "")
135 return string.match(clean, "^%s*(.-)%s*$") or clean
136end
137
138-- == Main Automation Loop (Cooking/Plating) ==
139task.spawn(function()
140 while task.wait(ActionDelay) do
141 local myLot = workspace:WaitForChild("PlayerLots"):FindFirstChild(player.Name)
142 if not myLot then continue end
143
144 -- Auto Cook
145 if Toggles.AutoCook then
146 for _, furniture in ipairs(myLot:GetChildren()) do
147 local grills = furniture:FindFirstChild("GrillSpots")
148 if grills then
149 for _, spot in ipairs(grills:GetChildren()) do
150 if isSpotEmpty(spot) then
151 local rawMeat = getAndEquipMeat("Raw")
152 if rawMeat then
153 ReplicatedStorage.Remotes.PlaceMeat:FireServer(spot, getCleanName(rawMeat.Name))
154 task.wait(ActionDelay)
155 end
156 else
157 local state = MeatStates[spot]
158 if not state then
159 local meatPart = spot:FindFirstChildWhichIsA("BasePart") or spot:FindFirstChildWhichIsA("UnionOperation")
160 if meatPart then
161 local bb = meatPart:FindFirstChild("CookBillboard")
162 if bb and bb:FindFirstChild("BG") and bb.BG:FindFirstChild("StateLabel") then state = bb.BG.StateLabel.Text end
163 end
164 end
165 if state == "Perfect" then
166 ReplicatedStorage.Remotes.PickupMeat:FireServer(spot)
167 MeatStates[spot] = nil
168 task.wait(ActionDelay)
169 end
170 end
171 end
172 end
173 end
174 end
175
176 -- Auto Plate
177 if Toggles.AutoPlate then
178 for _, furniture in ipairs(myLot:GetChildren()) do
179 local plates = furniture:FindFirstChild("Plates")
180 if plates then
181 for _, plate in ipairs(plates:GetChildren()) do
182 if isSpotEmpty(plate) then
183 local cookedMeat = getAndEquipMeat("Cooked")
184 if cookedMeat then
185 ReplicatedStorage.Remotes.PlaceMeat:FireServer(plate, getCleanName(cookedMeat.Name))
186 task.wait(ActionDelay)
187 end
188 end
189 end
190 end
191 end
192 end
193 end
194end)
195
196-- == Secondary Loop (Shop Buying) ==
197task.spawn(function()
198 while task.wait(1.5) do
199 -- Buy Meat
200 if Toggles.AutoBuy and #BuyTargets > 0 then
201 for _, targetMeat in ipairs(BuyTargets) do
202 if countMeatStock(targetMeat) < BuyThreshold then
203 ReplicatedStorage.Remotes.BuyMeat:FireServer(targetMeat, false)
204 task.wait(0.3)
205 end
206 end
207 end
208 -- Buy Totems
209 if Toggles.AutoBuyTotem and #BuyTotemTargets > 0 then
210 for _, targetTotem in ipairs(BuyTotemTargets) do
211 -- Buys totem using Cash (false) instead of Robux
212 ReplicatedStorage.Remotes.BuyShopItem:FireServer(targetTotem, false)
213 task.wait(0.3)
214 end
215 end
216 end
217end)
218
219-- == GUI CONSTRUCTION ==
220local sg = Instance.new("ScreenGui")
221sg.Name = "BBQMastery"
222sg.ResetOnSpawn = false
223pcall(function() sg.Parent = CoreGui end)
224if not sg.Parent then sg.Parent = player:WaitForChild("PlayerGui") end
225
226for _, child in ipairs(sg.Parent:GetChildren()) do
227 if child.Name == "BBQMastery" and child ~= sg then child:Destroy() end
228end
229
230local frame = Instance.new("Frame")
231frame.Size = UDim2.new(0, 270, 0, 360)
232frame.Position = UDim2.new(0.5, -135, 0.5, -180)
233frame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
234frame.BorderSizePixel = 0
235frame.Active = true
236frame.Draggable = true
237frame.Parent = sg
238Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 10)
239
240local title = Instance.new("TextLabel")
241title.Size = UDim2.new(1, 0, 0, 35)
242title.BackgroundTransparency = 1
243title.Text = "🖠BBQ MASTERY"
244title.TextColor3 = Color3.fromRGB(255, 120, 50)
245title.Font = Enum.Font.GothamBold
246title.TextSize = 18
247title.Parent = frame
248
249local closeBtn = Instance.new("TextButton")
250closeBtn.Size = UDim2.new(0, 30, 0, 30)
251closeBtn.Position = UDim2.new(1, -35, 0, 2)
252closeBtn.BackgroundTransparency = 1
253closeBtn.Text = "X"
254closeBtn.TextColor3 = Color3.fromRGB(255, 80, 80)
255closeBtn.Font = Enum.Font.GothamBold
256closeBtn.TextSize = 16
257closeBtn.Parent = frame
258closeBtn.MouseButton1Click:Connect(function() sg:Destroy() end)
259
260-- Tabs Container
261local tabFrame = Instance.new("Frame")
262tabFrame.Size = UDim2.new(1, 0, 0, 30)
263tabFrame.Position = UDim2.new(0, 0, 0, 35)
264tabFrame.BackgroundTransparency = 1
265tabFrame.Parent = frame
266
267local pageMeat = Instance.new("Frame")
268pageMeat.Size = UDim2.new(1, 0, 1, -65)
269pageMeat.Position = UDim2.new(0, 0, 0, 65)
270pageMeat.BackgroundTransparency = 1
271pageMeat.Parent = frame
272
273local pageTotems = Instance.new("Frame")
274pageTotems.Size = UDim2.new(1, 0, 1, -65)
275pageTotems.Position = UDim2.new(0, 0, 0, 65)
276pageTotems.BackgroundTransparency = 1
277pageTotems.Visible = false
278pageTotems.Parent = frame
279
280local function createTabButton(text, xPos, targetPage, isDefault)
281 local btn = Instance.new("TextButton")
282 btn.Size = UDim2.new(0.45, 0, 1, 0)
283 btn.Position = UDim2.new(xPos, 0, 0, 0)
284 btn.BackgroundColor3 = isDefault and Color3.fromRGB(255, 120, 50) or Color3.fromRGB(40, 40, 45)
285 btn.Text = text
286 btn.TextColor3 = isDefault and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
287 btn.Font = Enum.Font.GothamBold
288 btn.TextSize = 12
289 Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
290 btn.Parent = tabFrame
291 return btn
292end
293
294local btnTabMeat = createTabButton("🖠BBQ", 0.035, pageMeat, true)
295local btnTabTotem = createTabButton("🗿 TOTEMS", 0.515, pageTotems, false)
296
297btnTabMeat.MouseButton1Click:Connect(function()
298 pageMeat.Visible = true; pageTotems.Visible = false
299 btnTabMeat.BackgroundColor3 = Color3.fromRGB(255, 120, 50); btnTabMeat.TextColor3 = Color3.fromRGB(255, 255, 255)
300 btnTabTotem.BackgroundColor3 = Color3.fromRGB(40, 40, 45); btnTabTotem.TextColor3 = Color3.fromRGB(180, 180, 180)
301end)
302
303btnTabTotem.MouseButton1Click:Connect(function()
304 pageTotems.Visible = true; pageMeat.Visible = false
305 btnTabTotem.BackgroundColor3 = Color3.fromRGB(255, 120, 50); btnTabTotem.TextColor3 = Color3.fromRGB(255, 255, 255)
306 btnTabMeat.BackgroundColor3 = Color3.fromRGB(40, 40, 45); btnTabMeat.TextColor3 = Color3.fromRGB(180, 180, 180)
307end)
308
309-- Element Generators
310local function createToggle(parent, name, yPos, varName)
311 local btn = Instance.new("TextButton")
312 btn.Size = UDim2.new(0.85, 0, 0, 35)
313 btn.Position = UDim2.new(0.075, 0, 0, yPos)
314 btn.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
315 btn.Text = name .. " [OFF]"
316 btn.TextColor3 = Color3.fromRGB(200, 200, 200)
317 btn.Font = Enum.Font.GothamBold
318 btn.TextSize = 14
319 Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
320 btn.Parent = parent
321
322 btn.MouseButton1Click:Connect(function()
323 Toggles[varName] = not Toggles[varName]
324 if Toggles[varName] then
325 btn.BackgroundColor3 = Color3.fromRGB(255, 120, 50)
326 btn.Text = name .. " [ON]"
327 btn.TextColor3 = Color3.fromRGB(255, 255, 255)
328 else
329 btn.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
330 btn.Text = name .. " [OFF]"
331 btn.TextColor3 = Color3.fromRGB(200, 200, 200)
332 end
333 end)
334end
335
336local function createDropdown(parent, labelPrefix, yPos, options, targetTable)
337 local mainBtn = Instance.new("TextButton")
338 mainBtn.Size = UDim2.new(0.85, 0, 0, 35)
339 mainBtn.Position = UDim2.new(0.075, 0, 0, yPos)
340 mainBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 35)
341 mainBtn.Text = labelPrefix .. (#targetTable > 0 and string.sub(targetTable[1], 1, 15) or "None")
342 mainBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
343 mainBtn.Font = Enum.Font.Gotham
344 mainBtn.TextSize = 13
345 mainBtn.ZIndex = 5
346 Instance.new("UICorner", mainBtn).CornerRadius = UDim.new(0, 6)
347 Instance.new("UIStroke", mainBtn).Color = Color3.fromRGB(60, 60, 65)
348 mainBtn.Parent = parent
349
350 local list = Instance.new("ScrollingFrame")
351 list.Size = UDim2.new(0.85, 0, 0, 120)
352 list.Position = UDim2.new(0.075, 0, 0, yPos + 40)
353 list.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
354 list.BorderSizePixel = 0
355 list.ScrollBarThickness = 4
356 list.ScrollBarImageColor3 = Color3.fromRGB(255, 120, 50)
357 list.Visible = false
358 list.ZIndex = 10
359 list.CanvasSize = UDim2.new(0, 0, 0, #options * 30)
360 Instance.new("UICorner", list).CornerRadius = UDim.new(0, 6)
361 list.Parent = parent
362
363 Instance.new("UIListLayout", list)
364
365 for i, optName in ipairs(options) do
366 local optBtn = Instance.new("TextButton")
367 optBtn.Size = UDim2.new(1, 0, 0, 30)
368 optBtn.BackgroundColor3 = (i % 2 == 0) and Color3.fromRGB(40, 40, 45) or Color3.fromRGB(35, 35, 40)
369 optBtn.BorderSizePixel = 0
370 optBtn.Text = optName
371 optBtn.TextColor3 = table.find(targetTable, optName) and Color3.fromRGB(100, 255, 100) or Color3.fromRGB(220, 220, 220)
372 optBtn.Font = Enum.Font.Gotham
373 optBtn.TextSize = 12
374 optBtn.ZIndex = 11
375 optBtn.Parent = list
376
377 optBtn.MouseButton1Click:Connect(function()
378 local idx = table.find(targetTable, optName)
379 if idx then
380 table.remove(targetTable, idx)
381 optBtn.TextColor3 = Color3.fromRGB(220, 220, 220)
382 else
383 table.insert(targetTable, optName)
384 optBtn.TextColor3 = Color3.fromRGB(100, 255, 100)
385 end
386
387 if #targetTable == 0 then mainBtn.Text = labelPrefix .. "None"
388 elseif #targetTable == 1 then mainBtn.Text = labelPrefix .. string.sub(targetTable[1], 1, 15)
389 else mainBtn.Text = labelPrefix .. #targetTable .. " Selected" end
390 end)
391 end
392
393 mainBtn.MouseButton1Click:Connect(function() list.Visible = not list.Visible end)
394end
395
396-- Populate Tab 1: Meat
397createToggle(pageMeat, "Auto Cook (Perfect)", 10, "AutoCook")
398createToggle(pageMeat, "Auto Plate", 55, "AutoPlate")
399createToggle(pageMeat, "Auto Sell (NPC)", 100, "AutoSell")
400createToggle(pageMeat, "Auto Buy Meat", 145, "AutoBuy")
401createDropdown(pageMeat, "Buy Meat: ", 190, MeatOptions, BuyTargets)
402
403-- Populate Tab 2: Totems
404createToggle(pageTotems, "Auto Buy Totems", 10, "AutoBuyTotem")
405createDropdown(pageTotems, "Buy Totem: ", 55, TotemOptions, BuyTotemTargets)
406
407print("✅ BBQ Mastery v4 (Totems & Tabs) Loaded Successfully!")