Papyrus - make an item delete itself

Post » Mon Jun 18, 2012 9:41 am

I'm trying to make an item delete itself upon being equipped (it's going to do other things too, but once those are fired I want it to poof out of existence)


Scriptname Adorfscript extends ObjectReference  Event OnEquipped(Actor akActor)akActor.setscale(2)Self.Delete()endEvent

The setscale is just to verify that it was firing, and it is, when I equip it my character is doubled in size

I can't figure out why the item isnt being deleted though
User avatar
Rodney C
 
Posts: 3520
Joined: Sat Aug 18, 2007 12:54 am

Post » Mon Jun 18, 2012 8:26 am

Have you tried using "akActor.removeitem(self)"?
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Mon Jun 18, 2012 9:38 pm

Yeah that doesn't seem to do anything, I just want a weapon to be removed upon equip and am having a surprising amount of problems with it

Edit: I got it to work by creating a reference for the weapon

	akActor.removeitem(testweapon, 1)WEAPON Property testweapon  Auto  

Edit 2: It appears to just not work sometimes for no reason >_<

It will delete one but if I equip another the script wont fire a second time, but later it will
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am


Return to V - Skyrim