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?