Jump to content

[Help] Using GetItemCount


cuceta

Recommended Posts

Hello, how're you guys doing? This is my first post here in Nexus Forum

 

I'm making a simple papyrus script to get the ammout of Lesser Soul Gems in the Player's inventory, but so far i'm having troubles to get the value.

 

Here is my snippet:

 

;Ammout of Petty Soul Gems
int pettyQtd

;Calling Event (It is working in-game)
Event OnEffectStart(...)

;Attempt 1 (Player has 20 Petty Soul Gems)
pettyQtd = Game.GetPlayer().GetItemCount(SoulGemPetty) ;Script Error: variable SoulGemPetty is undefined

;Attempt 2 (Using SoulGem property SoulGemPetty Auto and the player having 20 Petty Soul Gems)
pettyQtd = Game.GetPlayer().GetItemCount(SoulGemPetty) ;Returns 0

;Output
Debug.MessageBox("You have " + pettyQtd + " Petty Soul Gems in your inventory); 

EndEvent

 

What am i doing wrong and how is the right form to get the information?

 

Sorry if this is the wrong place to post help and for my bad english, i'm from Brazil.

 

Thanks

Edited by cuceta
Link to comment
Share on other sites

  • Recently Browsing   0 members

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