Veladarius Posted April 9, 2013 Posted April 9, 2013 So I am trying to figure put how to make an item like a collar of cuffs that when equipped could not be removed by the player until they found a key. The idea I had was that you would have the object locked on and when you found a key for it and equipped it then the two would be replaced by an unequipped and unlocked item then equipping the item again would replace the unlocked item with the locked item and the key again. I am thinking of using this for a starting quest of having the items locked on and have to find the keys or keyholder. I have written several scripts which run but nothing happens and nothing shows in the papyrus log referencing the items. I have created 4 items: Slave Collar Unlocked: Activating this should remove the unlocked collar, add the locked collar and make it unremovable by the player [spoiler=Script 1]Scriptname playercollarlocking extends ObjectReferenceMiscObject Property Collarlockingmaster AutoObjectReference Property Collarlockingnewkey Auto{armor property slavecollarlocked autoarmor property slavecollarunlocked autoEvent onequipped()If player().isequipped(SlaveCollarlocked)endeventendifAdditem(SlaveCollarLocked, 1, false)Equipitem(SlaveCollarLocked,true)Removeitem(SlaveCollarUnlocked, 1, false)EndEvent}ObjectReference[] Property IsColarlocked Auto Slave Collar Locked: Should not be removable by player unless they use a key (no script) Collar Key Rusty: Will allow the player to unlock the collar once. Script should remove the locked collar and the key and add an unlocked collar [spoiler=Script 2]Scriptname CollarUnlocking1use extends objectreferenceMiscObject Property Collarkeyrusty AutoObjectReference Property Collarunlocking1 Auto{armor property slavecollarlocked autoarmor property slavecollarunlocked autoarmor property collarkey1use autoEvent onequiped()If player.isequipped (SlaveCollarlocked)additem (SlaveCollarUnlocked, 1, false)removeitem(SlaveCollarLocked,1)removeitem(Collarkeyrusty,1)endeventendifEndevent} Collar Key New: Should add a key that can unlock a collar any number of times. Script should remove the locked collar and replace it with an unlocked collar [spoiler=Script 3]Scriptname CollarUnlockingmaster extends objectreferenceMiscObject Property Collarkeyrusty AutoObjectReference Property Collarunlocking1 Auto{armor property slavecollarlocked autoarmor property slavecollarunlocked autoarmor property collarkeymaster autoEvent onequiped()If player.isequipped (SlaveCollarlocked)additem (SlaveCollarUnlocked, 1, false)removeitem(SlaveCollarLocked,1)unequipitem(Collarkeynew,1)endeventendifEndevent} This is the first time creating any scripts from scratch so I have no idea if these are correct. Any help would be appreciated.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.