Forum rules - please read before posting.

Checking through the player's inventory via script

Hello,

Simple question - how would I check through the player's inventory via script to see if they're carrying a certain item?

I've had a look at things like KickStarter.runtimeInventory.GetItem (int itemID); and KickStarter.runtimeInventory.localItems; but they give me lists. Is it not possible to just do a bool check on if a certain item ID is present in the player's runtime inventory?

Thanks!

Comments

  • edited July 2019

    GetItem returns an InvItem class - not a List. A simple null-check on the result can be used to determine if the player is carrying the item with the supplied ID value.

  • @ChrisIceBox Thank you, Chris. I must have been half asleep when I played around with it last night.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.