Hey developers, sorry I’m not experienced with tables and I’m getting nil when I print the pizza help would be appreciated.
local ServerStorage = game:GetService("ServerStorage")
local Order = ServerStorage.UI.Order
local Orderswall = game.Workspace.OrdersWall.Orders
local menu = {
1 == "Cheese Pizza",
2 == "Coke",
3 == "Big Mac",
4 == "Peperoni Pizza",
5 == "Chips"
}
local cooldown = script.Cooldown.Value
local maxOrderAmount = 5
local function order()
if cooldown == 0 and Orderswall.MaxOrders.Value > #Orderswall:GetChildren() then
local newOrder = Order:Clone()
newOrder.Parent = Orderswall
for i = 1, maxOrderAmount do
local number = math.random(1, 5)
local pizza = table.find(menu, menu[number])
print(pizza)
local itemUI = newOrder.Items.Item:Clone()
end
end
end
order()
local ServerStorage = game:GetService("ServerStorage")
local Order = ServerStorage.UI.Order
local Orderswall = game.Workspace.OrdersWall.Orders
local menu = {
1 == "Cheese Pizza",
2 == "Coke",
3 == "Big Mac",
4 == "Peperoni Pizza",
5 == "Chips"
}
local cooldown = script.Cooldown.Value
local maxOrderAmount = 5
local function order()
if cooldown == 0 and Orderswall.MaxOrders.Value > #Orderswall:GetChildren() then
local newOrder = Order:Clone()
newOrder.Parent = Orderswall
for i = 1, maxOrderAmount do
local number = math.random(1, 5)
local pizza = menu[number]
print(pizza)
local itemUI = newOrder.Items.Item:Clone()
end
end
end
order()