Quantcast
Channel: LucasForums - Holowan Laboratories
Viewing all articles
Browse latest Browse all 507

Equip item to player

$
0
0
I am trying to add and equip clothing to the player at the beginning of the game. The adding item part of the script works, as does the execution of the original area script, and the clothes are added to the inventory fine. However the item will not equip. No matter what I try. Increasing the delay, firing the script in different spots. I cannot get items to equip to the PC. Does anyone know a solution?

Code:

void main()
{
    object oEnter = GetEnteringObject();
   
    if ((oEnter == GetFirstPC()) && !GetLocalBoolean(OBJECT_SELF, 2))
    {
        object oItem = CreateItemOnObject("g_a_clothes01", oEnter);
        DelayCommand(0.5, AssignCommand(oEnter, ActionEquipItem(oItem, INVENTORY_SLOT_BODY, TRUE)));

        SetLocalBoolean(OBJECT_SELF, 2, TRUE);
    }
   
    ExecuteScript("k_pend_area01_1", OBJECT_SELF);
}


Viewing all articles
Browse latest Browse all 507

Trending Articles