I'm wanting to make an item (an amulet) that is Cursed, and cannot be unequipped for a mod I'm developing. I've been trying some things and I came up with this, but I'm not sure this example works:
Also, it's standard Skyrim, not SE.
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
If akBaseObject as Armor == YourArmorItem
MakeImpossibleToRemove(akBaseObject)
ElseIf akBaseObject as Weapon == YourWeaponItem
MakeImpossibleToRemove(akBaseObject)
EndIf
EndEvent
Function MakeImpossibleToRemove(Form CurrentObject)
Self.GetActorReference().UnequipItem(CurrentObject,false,false)
Utility.Wait(0.1)
Self.GetActorReference().EquipItem(CurrentObject,true,false)
EndFunction
What exactly am I doing wrong here, it just isn't working in game.