im making a bike spawner system and i want to call a function if a category returns nothing, but i have no idea how to do that
local function Update(CATEGORIA)
if Debounce or CurrentCategory == CATEGORIA then return end
CurrentCategory = CATEGORIA
Debounce = true
Clear()
for _,OBJETO in pairs(script:FindFirstChild(CATEGORIA):GetChildren()) do
--if pairs returns nil, call a function
local Clonned = BIKE_MODEL:Clone()
Clonned.Name = OBJETO.Name
Clonned.BIKE_NAME.Text = OBJETO.Name
Clonned.MouseButton1Click:Connect(function()
end)
Clonned.Parent = SCROLLFRAME
Clonned.Viewport:SetAttribute("ItemDisplay",OBJETO.Name)
end
task.wait()
Debounce = false
end