Jump to content

Help unequip current item SCRIPT


Koalmex

Recommended Posts

Depends upon what it is you are trying to do and where the script is actually located.

 

There are two things that you need: 1. the actor wearing the object 2. the object itself

 

Examples:

If only the player can ever wear the object and the object is the one holding the script...

Game.GetPlayer().UnequipItem(Self)

If only the player can ever wear the object and a player alias on a quest is the one holding the script...

Self.GetReference().UnequipItem(MyItem)
;where MyItem is a property variable that you have assigned the desired object 

If only the player can ever wear the object and the script is held on any other form/record...

Game.GetPlayer().UnequipItem(MyItem)
;where MyItem is a property variable that you have assigned the desired object

I am not going to say it is impossible but it is much more difficult to obtain some random actor that might be wearing the item just so you can unequip it.

 

Thus it depends on what it is you are wanting to do as well as where the script is located as to how you get the necessary information.

Link to comment
Share on other sites

Depends upon what it is you are trying to do and where the script is actually located.

 

There are two things that you need: 1. the actor wearing the object 2. the object itself

 

Examples:

If only the player can ever wear the object and the object is the one holding the script...

Game.GetPlayer().UnequipItem(Self)

If only the player can ever wear the object and a player alias on a quest is the one holding the script...

Self.GetReference().UnequipItem(MyItem)
;where MyItem is a property variable that you have assigned the desired object 

If only the player can ever wear the object and the script is held on any other form/record...

Game.GetPlayer().UnequipItem(MyItem)
;where MyItem is a property variable that you have assigned the desired object

I am not going to say it is impossible but it is much more difficult to obtain some random actor that might be wearing the item just so you can unequip it.

 

Thus it depends on what it is you are wanting to do as well as where the script is located as to how you get the necessary information.

 

 

Yes, the item has the script, but it does not work :(

When I equip the item to activate the script, nothing happens.

 

 

85e4904cdd7af5c6cf7b18497d6ebc3b.png

Link to comment
Share on other sites

Is the item you are working with already in the player's inventory when adding this script? if so, drop it and delete it. Console in a new instance. If that doesn't work, test on a new game or a save that has not seen your mod. Reason being is that some changes will not take affect on objects which have already been saved to the save file. This may be one of them.

Link to comment
Share on other sites

Is the item you are working with already in the player's inventory when adding this script? if so, drop it and delete it. Console in a new instance. If that doesn't work, test on a new game or a save that has not seen your mod. Reason being is that some changes will not take affect on objects which have already been saved to the save file. This may be one of them.

 

Nothing :(

Link to comment
Share on other sites

I'm going out on a limb here.. but I think there's a conflict with the names. The form(the item), the name of the form, and the script are using the same name. Change these names(the Form can keep the name) and try again.

 

I tried and that is not the problem :(

Link to comment
Share on other sites

First, indent the line with the unequipitem function in it.

 

if that doesn't work, Try changing the extends from "ObjectReference" to "Armor"

 

If that doesn't work, try making the armor a property and using this:

Game.GetPlayer().Unequipitem(property name)

 

If none of that works and you're feeling like using a script loophole, you could always make the item a property and use this:

Game.GetPlayer().Removeitem(property name, 1)

Game.GetPlayer().Additem(property name, 1)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...