Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
m
imported>JustinOther
m (→‎Script a container that only accepts certain types of items: GetPlayer swapped for PlayerREF for consistency and 'cause it's leagues faster/cheaper)
imported>JustinOther
Line 686: Line 686:


<source lang="papyrus">
<source lang="papyrus">
Actor Property PlayerREF Auto
FormList Property FoodList Auto
FormList Property FoodList Auto
Bool hasBeenFedToday = False
Bool hasBeenFedToday = False
Line 696: Line 697:


Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
If akSourceContainer == Game.GetPlayer()
If akSourceContainer == PlayerREF
RemoveItem(akBaseItem,aiItemCount)
RemoveItem(akBaseItem,aiItemCount)
If !hasBeenFedToday
If !hasBeenFedToday
Anonymous user

Navigation menu