HeirOfTheSeptims Posted October 5, 2017 Share Posted October 5, 2017 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 EndIfEndEvent RemoveItem is not a function or does not existNo 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 More sharing options...
HeirOfTheSeptims Posted October 5, 2017 Author Share Posted October 5, 2017 Using RemoveAllItems in its place caused the same error as well: RemoveAllItems is not a function or does not exist. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 5, 2017 Share Posted October 5, 2017 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 More sharing options...
HeirOfTheSeptims Posted October 5, 2017 Author Share Posted October 5, 2017 That fixed it, thank you! :D Link to comment Share on other sites More sharing options...
Recommended Posts