So as the title said I am trying to make a script I have thread safe, but I don't really get the instructions on the wiki. Can anyone help me to do this? Also, if anyone has any suggestions on how to improve this it would really help.
Spoiler
Scriptname abecanCraft extends ObjectReference ObjectReference Property abecancraftcontAllItems Auto ObjectReference Property abecancraftcontPlayerChoose Auto Message Property abecancrafttestmessage01 Auto int numItemsToAddEvent OnActivate(ObjectReference akActionRef) if (akActionRef==Game.getPlayer()) numItemsToAdd = 100 abecanCraftMenuTest1() endIfEndEventFunction abecanCraftMenuTest1(int aibutton = 0) aibutton = abecancrafttestmessage01.show() ;What would you like me to brew if (aibutton == 0); ok populatecontPlayerChooseOnce() else endIfendFunctionFunction populatecontPlayerChooseOnce() int counter = 0 int tracker = 0 int ApothMerchChestlength = abecancraftcontAllItems.getNumItems() while counter