Jump to content

Need help with very simple script


sh0ker

Recommended Posts

Hey there.

I am new to scripting and I am trying to learn so today I was messing with some code and there's something small I couldn't figure out why it's not working

foreach rItem <- PlayerREF

	rItem.UnequipMe

loop

This is a simple code to unequip all the items the player wear, it works perfectly but when i try this function instead, it doesn't :

foreach rItem <- PlayerREF

PlayerREF.UnEquipItem rItem 0 1

loop

anyone know why when I use UnequipItem it doesn't work?

thanks in advance

Link to comment
Share on other sites

I'm guessing because rItem contains an inventory reference and not a base object.

 

UnequipMe runs on an inventory reference but not a base object, UnequipItem runs on a reference to an actor and takes a base object as the first parameter.

 

Try retrieving the reference's base object first:

foreach rItem <- PlayerREF

set rBase to rItem.GetBaseObject
PlayerREF.UnEquipItem rItem 0 1

loop
Link to comment
Share on other sites

 

I'm guessing because rItem contains an inventory reference and not a base object.

 

UnequipMe runs on an inventory reference but not a base object, UnequipItem runs on a reference to an actor and takes a base object as the first parameter.

 

Try retrieving the reference's base object first:

foreach rItem <- PlayerREF

set rBase to rItem.GetBaseObject
PlayerREF.UnEquipItem rItem 0 1

loop

Thanks I am going to try this out

edit :

It works! thank you again

Edited by sh0ker
Link to comment
Share on other sites

  • Recently Browsing   0 members

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