Jump to content

Script Issue. Type object availability in inventory check


Recommended Posts

Is it a way to make script check if player has ANY object of certain type? 


Context: I have activator "if player has poison in inventory he can poison an object". But Idk what function can do that. I need smth which will check if player has ANY of poisons in his inventory (potion poison or smth like that) and if it's true, messagebox can let him poison an object.

Thanks to anybody who'd try to help.

Link to comment
Share on other sites

That inventory method will not work for crafted potions.  Here is how to make it work for all (reference)

foreach refItem <- player

     if refItem.GetObjectType == 40      ; Alchemy Item

          if refItem.IsPoison

                 ; Found the first poison in the inventory

          endif

     endif

loop

 

Edited by GamerRick
Stupid smiley face
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...