lua:ch:carries
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
lua:ch:carries [2017/02/20 05:54] – created vodur | lua:ch:carries [2024/07/09 03:06] (current) – astark | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | CH:carries( arg[string] ) | + | CH:carries( arg<string> |
Return type: boolean | integer | Return type: boolean | integer | ||
- | arg can be a vnum or a name. Return false if CH does not carry any object with that vnum/name, otherwise return the count of that vnum/name carried. | + | arg can be a vnum or a name. Vnum doesn' |
+ | |||
+ | <code lua> | ||
+ | -- 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: | ||
+ | dark = true | ||
+ | end | ||
+ | if players: | ||
+ | yellow = true | ||
+ | end | ||
+ | if players: | ||
+ | blue = true | ||
+ | end | ||
+ | if players: | ||
+ | green = true | ||
+ | end | ||
+ | end | ||
+ | |||
+ | echo(" | ||
+ | |||
+ | if rand(70) then | ||
+ | if dark == false then | ||
+ | mob: | ||
+ | elseif yellow == false then | ||
+ | mob: | ||
+ | elseif blue == false then | ||
+ | mob: | ||
+ | elseif green == false then | ||
+ | mob: | ||
+ | end | ||
+ | end | ||
+ | |||
+ | </ | ||
lua/ch/carries.1487570041.txt.gz · Last modified: 2017/02/20 05:54 by vodur