Re: Deleting an item in inventory?
I think for your code, self.weap should be pointing to an MO, so I don't think this'll actually work.
This has been my code so far:
Code:
for actor in MovableMan.Actors do
if actor:IsPlayerControlled() == true then
for i = 1, MovableMan:GetMOIDCount()-1 do
gun=MovableMan:GetMOFromID(i);
if gun.PresetName == "M16" and gun.RootID == actor.ID then
gun.ToDelete = true
end
end
end
end
It deletes the weapon you're currently holding if it's an M16, but does not delete ones in the inventory.