Hi, just a question for container insert scripts. If a script tries creating an object in a full container it won't succeed, so apart from making the check in the createitem script (which should be done anyway) is there a way to check if an item was succesfully inserted into a container via the insert script?
Obviously you return 1 to allow an item to be inserted etc, I just want to know if theres a way i can do something like (if iteminsert doesn't succeed move it to containers xyz or the mobile its running for xyz).
Sorry if this is a stupid question.
Insert Scripts
In my OnInsert script I have this check to prevent more than one item being added at once.
Is that what you are looking for?
Code: Select all
if(GetObjProperty(container, "Hold"))
SendSysMessage(who, "You can only add one item at a time.");
if(!MoveItemToContainer(item, who.backpack))
MoveObjectToLocation(item, who.x, who.y, who.z, who.realm, MOVEOBJECT_FORCELOCATION);
endif
return;
endif