ZombicideII Posted July 22, 2018 Share Posted July 22, 2018 (edited) I have 2 scripts that for some reason aren't working the way they're suppose to. I have one script on a button and it's suppose to remove all items in a formlist (all other buttons set-up the EXACT same way, work as intended). Instead this one removes 1 item in the formlist and the button needs to be activated multiple times. Formlist Property UHModsList AutoObjectReference Property UHModCont AutoActor Property PlayerRef1 AutoInt Property UHobjCount AutoMessage Property ErrorMessage Auto Event OnActivate(ObjectReference akActionRef)UHobjCount == PlayerRef1.GetItemCount(UHModsList)PlayerRef1.RemoveItem(UHModsList, UHobjCount, True, UHModCont)If UHobjCount == 0ErrorMessage.Show()elsedebug.notification("Mods stored")EndIfEndEvent The second script, can anyone tell me why this script for a container removes all but 1 item? The item is Acid Component, it is in the formlist, i've checked numerous times. FormList Property UHJunk1 Auto ObjectReference Property UHJunkContainer Auto Event OnInit()AddInventoryEventFilter(UHJunk1)EndEventEvent OnItemAdded(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContianer)If(UHJunk1.Find(akBaseItem) > 0) UHJunkContainer.AddItem(AkBaseItem, aiItemCount); akItemReference.MoveTo(UHJunkContainer) Self.RemoveItem(akBaseItem, aiItemCount)EndIf EndEvent Code Box is being dumb ^ Edited July 22, 2018 by ZombicideII Link to comment Share on other sites More sharing options...
akiras404 Posted July 22, 2018 Share Posted July 22, 2018 First one, "==" shouldn't be "=" ? Event OnActivate(ObjectReference akActionRef) UHobjCount = PlayerRef1.GetItemCount(UHModsList) PlayerRef1.RemoveItem(UHModsList, UHobjCount, True, UHModCont) Second one, it isn't ">=0"? If(UHJunk1.Find(akBaseItem) >= 0) Link to comment Share on other sites More sharing options...
ZombicideII Posted July 23, 2018 Author Share Posted July 23, 2018 I feel dumb for not seeing the first code; == needing to be = As far as the second code, I tried that, still removes all but 1 item out of the container from the formlist. Link to comment Share on other sites More sharing options...
Recommended Posts