I recently made a script to make it impossible to obtain an item from pickpocketing it from the NPC that carries it. I first tested it out by putting the item on the ground then picking it up, the script worked perfectly and removed it from my inventory, but when i put it in the NPC's inventory and tried to take it from his inventory, the game crashed, it does this every time i do it. It wasn;t a random occurance
This is the script:
scn CantRemoveScript
short itemcount
begin GameMode
set itemcount to Player.GetItemCount MySword
if itemcount >= 1
MessageBox "You can't take this"
Player.RemoveItem MySword 1
MyDude.AddItem MySword 1
endif
end
This is script for the object and i was wondering if any advanced scripters could help me out on this one, help would be very appreciated.