How would i make a random order system?

so i have a game, and the game requires items to be placed based on orders, but the orders are not very, err… random…

local function processOrder()
	if script.Parent.Order.Value == 1 and box then
		box = false
		wait()
		script.Parent.Box:Destroy()
		script.Parent.Order.Value = 0
		script.Parent.ParticleEmitter:Emit(30)
	elseif script.Parent.Order.Value == 2 and box and crate then
		box = false
		crate = false
		wait()
		script.Parent.Box:Destroy()
		script.Parent.Crate:Destroy()
		script.Parent.Order.Value = 0
		script.Parent.ParticleEmitter:Emit(30)
	elseif script.Parent.Order.Value == 3 and crate then
		crate = false
		wait()
		script.Parent.Crate:Destroy()
		script.Parent.Order.Value = 0
		script.Parent.ParticleEmitter:Emit(30)
	elseif script.Parent.Order.Value == 4 and barrel then
		barrel = false
		wait()
		script.Parent.Barrel:Destroy()
		script.Parent.Order.Value = 0
		script.Parent.ParticleEmitter:Emit(30)
	end
end

so is there a way i can do this better?

use math.random() or a Random object

yes i know but how would i make a random sequance and make it readable to the server and do accordingly

If I understand your script correctly, you could just put this at the top of the function

local RandomOrderNumber = math.random(1, TheAmountOfOrdersThereAre)

If you need multiple different items per order, you could just copy and paste that and then make sure that the variables don’t have the same value.