Jump to content

Help unequip current item SCRIPT


Koalmex

Recommended Posts

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)

What is indent?

Scriptname zxAnger3 extends ObjectReference
{asd}
Armor Property Anger3 Auto
Event OnEquipped(Actor akActor)
Game.GetPlayer().Unequipitem(Anger3)
EndEvent

I do not know if I did it right, it does not work

 

 

The remaining obvious question: Have you compiled the script? Do you have a PEX version in your scripts folder? If not, then you need to compile / build the script after writing / editing.

 

Beyond that, without actually seeing everything you are doing, I cannot help.

 

Yes, I am saving the script well, I know it because I have another function in the same script that works, but the UnEquip does not work

Edited by Koalmex
Link to comment
Share on other sites

Intending is what you didn't do on either script. You press "tab" in front of the line to make it shift over a sizable space, like this:

Scriptname zxAnger3 extends ObjectReference

Armor Property Anger3 Auto

Event OnEquipped(Actor akActor)
	Game.GetPlayer().Unequipitem(Anger3)
EndEvent

As opposed to

Scriptname zxAnger3 extends ObjectReference

Armor Property Anger3 Auto

Event OnEquipped(Actor akActor)
Game.GetPlayer().Unequipitem(Anger3)
EndEvent
Link to comment
Share on other sites

 

Intending is what you didn't do on either script. You press "tab" in front of the line to make it shift over a sizable space, like this:

Scriptname zxAnger3 extends ObjectReference

Armor Property Anger3 Auto

Event OnEquipped(Actor akActor)
	Game.GetPlayer().Unequipitem(Anger3)
EndEvent

As opposed to

Scriptname zxAnger3 extends ObjectReference

Armor Property Anger3 Auto

Event OnEquipped(Actor akActor)
Game.GetPlayer().Unequipitem(Anger3)
EndEvent

I did not know, I already tried and it did not work :(

Link to comment
Share on other sites

Add a Debug.Notication line temporarily to ensure that the OnEquipped event is being triggered. If that works, it could be possible that UnequipItem is one of the functions that does not work on scripts on objects when they are stored inside of a container or inventory. If that is the case, you'll have to go with a different approach.

Link to comment
Share on other sites

Add a Debug.Notication line temporarily to ensure that the OnEquipped event is being triggered. If that works, it could be possible that UnequipItem is one of the functions that does not work on scripts on objects when they are stored inside of a container or inventory. If that is the case, you'll have to go with a different approach.

 

The "OnEquipped" works, since I have another script inside it

 

Edited by Koalmex
Link to comment
Share on other sites

  • Recently Browsing   0 members

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