StrangeAngelx92 Posted September 8, 2015 Share Posted September 8, 2015 (edited) I need help trying to write a script for a container, I have been looking for a few days now but i havent found anything.What i want the script to do is two things. First i need the script to set a limit of x amount of items on a container, setting it up to check the amount of items in the container and kick back to the player any items over the limit.(Ex. if set a limit of 30 and you add 31 items to a chest, it will kick back the extra 1 maybe with a message saying "that ____ is full") Second i need a script that checks the amount of items in a container and enabled a static object based on how many items the container has.(Ex. If you add 1-10 health potions its enables 1 static health potion on the display, if you have 11-20 it enables 2 static Health potions, If 21-30 enables 3 and so on) ok figured out both parts (such a pain in the a**)But now i need help with Figuring out how to reject items not on a formlistim soo close to completeing this script any help would be appreciated. Ok I totally figured this out FINALLY lol Happy Modding Everyon lol AlsoIf someone is looking for a similar script as to the above im gonna post it below:Scriptname A1A1NewChestScript extends ObjectReference ObjectReference Property DisplayRef_01 AutoObjectReference Property DisplayRef_02 AutoObjectReference Property DisplayRef_03 AutoFormList Property Display_FormList_Multi_01 AutoActor Property PlayerREF AutoInt Property IntegerRestrict Auto;----------------------------------------------------------------------------------------------------------------------------------------------------------------------Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If Display_FormList_Multi_01.HasForm(akBaseItem) && GetItemCount(Display_FormList_Multi_01) >= 1 DisplayRef_01.Enable() EndIf If Display_FormList_Multi_01.HasForm(akBaseItem) && GetItemCount(Display_FormList_Multi_01) >= 11 DisplayRef_02.Enable() EndIf If Display_FormList_Multi_01.HasForm(akBaseItem) && GetItemCount(Display_FormList_Multi_01) >= 21 DisplayRef_03.Enable() EndIf If IntegerRestrict == 1 && GetItemCount(Display_FormList_Multi_01) >= 31 RemoveItem(akBaseItem, aiItemCount, True, akSourceContainer) Debug.Notification("Cannot Hold Anymore Objects") ElseIf IntegerRestrict == 1 && Display_FormList_Multi_01.HasForm(akBaseItem) == False RemoveItem(akBaseItem, aiItemCount, True, akSourceContainer) Debug.Notification("That Does Not Go There") ElseIf IntegerRestrict == 0 ;Do Nothing EndIfEndEvent;----------------------------------------------------------------------------------------------------------------------------------------------------------------------Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)RegisterForSingleUpdate (10.0) If Display_FormList_Multi_01.HasForm(akBaseItem) && GetItemCount(Display_FormList_Multi_01) <= 0 DisplayRef_01.Disable() EndIf If Display_FormList_Multi_01.HasForm(akBaseItem) && GetItemCount(Display_FormList_Multi_01) <= 10 DisplayRef_02.Disable() EndIf If Display_FormList_Multi_01.HasForm(akBaseItem) && GetItemCount(Display_FormList_Multi_01) <= 20 DisplayRef_03.Disable() EndIfEndEvent;----------------------------------------------------------------------------------------------------------------------------------------------------------------------Event OnUpdate() If GetItemCount(Display_FormList_Multi_01) <= 0 DisplayRef_01.Disable() EndIf If GetItemCount(Display_FormList_Multi_01) <= 10 DisplayRef_02.Disable() EndIf If GetItemCount(Display_FormList_Multi_01) <= 20 DisplayRef_03.Disable() EndIfUnregisterForUpdate()EndEventThe "OnUpdate" is just to make sure the proper statics are enabled/disabled incase you use "Take All" as the script without the "OnUpdate" does not disable the items properly in that instance. Edited September 9, 2015 by StrangeAngelx92 Link to comment Share on other sites More sharing options...
Recommended Posts