Jump to content

"RemoveItem is not a function or does not exist.." I'm pretty sure it does...


Recommended Posts

So I'm throwing together a simple script to pull a weapon from a container to the player's inventory when they hit an activator, but the compiler is throwing a "does not exist" error that makes no sense.. I double checked the CK wiki https://www.creationkit.com/index.php?title=RemoveItem_(Papyrus), and its a member of ObjectReference script.

 

 

Scriptname WeaponPickupScript extends ObjectReference

WEAPON Property WeaponToGive Auto

Container Property HoldingBox Auto

 

Event OnActivate(ObjectReference AkActivator)
If(AkActivator == Game.GetPlayer())
HoldingBox.RemoveItem(WeaponToGive, 1, False, Game.GetPlayer())
Else
EndIf
EndEvent

 

 

RemoveItem is not a function or does not exist
No output generated for WeaponPickupScript, compilation failed.

 

 

Does anybody know why the heck its throwing this error? Am I just missing something that should be obvious?

Link to comment
Share on other sites

You are using the incorrect property type for your container. Container object type seems to be a left over from early development which may explain why the container.psc is empty of any functions or events.

 

The proper method is to use an ObjectReference property which points to the specific placed container. Then RemoveItem and RemoveAllItems will work as intended.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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