ArtemSHikoff Posted December 24, 2023 Share Posted December 24, 2023 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 More sharing options...
LenaWolfBravil Posted December 24, 2023 Share Posted December 24, 2023 There are a number of functions in OBSE that can help you do it. To check for poison: IsPoison. This is how to walk through the inventory. Link to comment Share on other sites More sharing options...
GamerRick Posted December 24, 2023 Share Posted December 24, 2023 (edited) 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 December 24, 2023 by GamerRick Stupid smiley face Link to comment Share on other sites More sharing options...
ArtemSHikoff Posted December 24, 2023 Author Share Posted December 24, 2023 Thank you, people! I'll try it Link to comment Share on other sites More sharing options...
Recommended Posts