Another problem about 'random' (interval is empty)

I got an error that said:
Workspace.Trigger.Script:19: invalid argument #1 to ‘random’ (interval is empty) - Server - Script:19

I don’t know what to do at all. I checked other posts but they seem to have a different solution. What should I do in this case?

Code:

local Players = game:GetService('Players')
local ServerStorage = game:GetService('ServerStorage')

local Trigger = script.Parent
local Obby = Trigger.Parent

Trigger.Touched:Connect(function(part)
	-- Check if the player touches it
	local character = part.Parent
	local player = Players:GetPlayerFromCharacter(character)
	if not player then return end
	
	-- Disable trigger
	script.Enabled = false
	
	-- Create a new obby
	local ObbyStructure = ServerStorage:WaitForChild('ObbyStructure')
	local Obbies = ObbyStructure:GetChildren()
	local ChosenObby = Obbies[math.random(#Obbies)] -- Heres the problem
	
	local ObbyCount = ServerStorage.Values:FindFirstChild('ObbyCount')
	ObbyCount.Value += 1
	
	local PreviousObby = workspace:FindFirstChild('Obby'..(ObbyCount.Value - 1)) or nil
	local Finish = nil
	if PreviousObby then Finish = PreviousObby:FindFirstChild('Finish') end
	
	ChosenObby.Parent = workspace
	ChosenObby.Name = 'Obby'..ObbyCount.Value
	ChosenObby:PivotTo((Finish or workspace.StartSpawn.Finish).CFrame)
	
	-- Obby to be destroyed
	local ExistingObbies = ServerStorage.Values:FindFirstChild('ExistingObbies')
	local ObbyTBD = workspace:FindFirstChild('Obby'..(ObbyCount.Value - ExistingObbies.Value))
	if ObbyTBD then ObbyTBD:Destroy() end
	
	-- Move and enable trigger
	Trigger.Position = ChosenObby.Checkpoints.Checkpoint.Position + Vector3.new(0, 4.5, 0)
	script.Enabled = true
end)

My goal here is to make an infinitely generating obby, that is. There are 6 models in the ‘ObbyStructure’ folder but somehow it doesnt even know how many

I tried to set math.random to 6 but it doesnt even get an item from the object

That would mean there is nothing in it, as if you only apply a maximum value, the default minimum is 1, so the code would be seeing that the mimimum is 1, but the maximum is 0.

‘Obbies’ is empty. The problem lays in fetching ObbyStructure. Put a temporary obby in workspace and try it on that, see if it works.

Have you tried doing
local ChosenObby = Obbies[math.random(1, #Obbies)]
instead?