Skip to content

CreateItemOnObject Issues

jimnjjimnj Member Posts: 1
Hello, hoping for some help. Thanks in advance.

Here is the code I am working with, it drops loot when a monster dies.
    
    int nL1 = GetLocalInt(OBJECT_SELF, "roll_01");
    string sL1 = GetLocalString(OBJECT_SELF,"loottag_01");
    int roll_1 = d100();
   
    if (roll_1<=nL1)
    {
    CreateItemOnObject(sL1, OBJECT_SELF);
    }

So it works. The issue is, that I have to use the items tag. When I look this function up, it says it needs to be the resref (blueprint).

Another issue I am having, is I made a key called "crypt key". The item tag is "it_cryptkey" and the resref is "cryptkey". If i try to add this item into my local variable as a string called "loottag_01" it will not drop. I tried using the resref and the tag. I am at a loss. I tried making other items using the item wizard and none of my "custom" items will drop.

Any help would be appreciated.

Thanks,

Comments

  • ProlericProleric Member Posts: 1,281
    You do need to use the resref.

    Check that the local variable is set (a common error is to enter a local variable but not use the Add button).

    Check that the value is identical to the resref.
Sign In or Register to comment.