Select a random object that NPC carries?

I’m trying to select a random object in an NPC’s inventory for a simple gambling minigame, and I don’t know how to do this.

I get an error on the phrase “random object that the gambler carries.” Inform doesn’t seem to know what to do with this, but I don’t know what else to try.

(I’m also using Conversation Framework, Conversational Defaults, and Conversation Responses by Eric Eve, and I have a property called “met,” but that is all working fine.)

Here’s what I have right now:

Gambler-bet is an object that varies.

Response for the gambler when the gambler is met:
	if the gambler carries something:
		say "He can't talk to you, but he will play a simple dice game with you. Do you want to play?";
		if the player consents:
			 now gambler-bet is a random object that the gambler carries;
			 say "He puts down [the printed name of gambler-bet].";
             [minigame continues]

Any help would be much appreciated! Thank you!


a random object carried by the gambler


Thank you!!!

1 Like