CH:carries( arg<string>|<integer> )

Return type: boolean | integer

arg can be a vnum or a name. Vnum doesn't need to be stringified. Return false if CH does not carry any object with that vnum/name, otherwise return the count of that vnum/name carried.

-- DEATH. Chemist. Loads vials on random chance but intelligently.
dark = false
yellow = false
blue = false
green = false
 
for _,players in ipairs(mob.room.players) do
  if players:carries("20110") or players:ccarries("20110") then
    dark = true
  end
  if players:carries("20111") or players:ccarries("20111") then
    yellow = true
  end
  if players:carries("20112") or players:ccarries("20112") then
    blue = true
  end
  if players:carries("20113") or players:ccarries("20113") then
    green = true
  end
end
 
echo("passed for loop")
 
if rand(70) then
  if dark == false then
    mob:oload(20110)
  elseif yellow == false then
    mob:oload(20111)
  elseif blue == false then
    mob:oload(20112)
  elseif green == false then
    mob:oload(20113)
  end
end