Hey there
Which part in the script would I need to change if I wanted the empty container timer to start upon a player entering the container? The reason why I ask is that I have an XP plugin configured to issue XP OnLootEntity so would like to try and avoid spam XP issues.
Emptying container OnLootEntityEnd
Any XP plugin that grants XP when a container is looted should ideally only grant XP when the container is looted for the first time. That is a problem for the XP plugin to solve, not for Loot Bouncer to solve.
Yes I understand that but it is something which I have coded into the XP plugin as it wasn;t an original feature of that plugin. But at the moment it is possible for a player to spam enter/exit a container to gain xp. That's why I was asking the question.
Have you tried setting "Time before the loot containers are empties (seconds)": 0.0 in the config? That will likely cause the entity to despawn one frame after the player stops looting the container. It will be very difficult for the player to reopen the container before it despawns.
Yes, the problem is that if a player doesnt loot any items from the container, the timer doesn't even start. :-)
I think the if (lootContainer.inventory.itemList.Count < tempItemsCount) check is probably what's preventing the timer from starting. Change that to <= will probably produce the behavior you want.
Long term, fix the XP plugin.
Thanks that works.
Unfortunately due to my limited knowledge with C# introducing a check into the XP plugin which is no longer maintained is way beyond my capabilities which is why I came to you for help in your plugin as I have been using it for going on two years now.