isholding
isholding <entity> <vnum>
Whether an entity holds or contains an object of a given vnum.
The first argument may be a creature, an object, or a room. For a creature,
isholding searches its carried inventory; for an object, its contents
(treating it as a container); for a room, the objects lying in that room.
Worn equipment and implants are not searched — use
iswearing for those.
Arguments
<entity>— a creature, object (container), or room to search.<vnum>— an int, the object vnum to look for.
Returns
A bool — true if a matching object is found directly inside the entity, false otherwise.
Examples
after command (say) {
oload 1
do "say isholding=[isholding $self 1]."
}
oload places object vnum 1 into the owner's inventory, so
[isholding $self 1] is true.
before command (north) {
require [isholding $actor 1]
do "say The gate recognises your token."
}
This guard lets the actor pass only while carrying an object of vnum 1;
otherwise the script advances to the next matching handler (see
require).