Jump to content

[LE] Papyrus Error: RemoveItem does not exist


09jlardinois

Recommended Posts

All good, I figured that was the goal you just can't add that to the

Oninit() event as that kicks off everytime the game is loaded.

In an Event OnActivate() or any other Event that would fire and be fine.

 

For the Oninit() it should read:

----

Event OnInit()
; some stuff needed for this script
; some stuff needed for this script
GoToState("Done")
EndEvent
or just
Event OnInit()
GoToState("Done")
EndEvent
Your Event OnWhatever() here
Game.GetPlayer().RemoveItem(Gold001, 1000, true)
GoToState("Done") ; you can drop this in or not
EndEvent
Ending the script with a:
----
State done
;do nothing
endState
All your "OnEvent" Events will still trigger fine.
This is so when Skyrim loads up your script don't
bog it down at all, adding to longer loading times.
Unless this is a fragment script off a quest. I really haven't worked with them to much.
It may even be the way to do it there ... ( for said reason )
Also: just like to add the variable you used Gold001 just happen to be the real global variable
Skyrim uses for player gold ... So Autofill will work when adding it in the Creation Kit nicely.
Without having to add a definition for a new variable and swapping values back and forth.
Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

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