This is a player held weapons spawning system
A few attributes are named weirdly, mostly because I key-smash to name them.
Translations:
-wesps =weapon number.
-dats = a cancellation boolean so when a held weapon is spawned, it stops any others from spawning.
-wep = A attribute to set player animations depending on weapon held.
So whenever the player presses E, it's supposed to check through the game's weapon library. If it finds one, the code is stopped on the current weapon number. The "X has?" booleans checks if the player has the weapon.
If both the weapon number, and the weapon has boolean are true to it's question input, it'll spawn a held weapon and stop until you press E again. But if no weapon is found, it's skipped.
The next time you press E, it will repeat above until you get to the next weapon.
If none are found, it goes to none held, otherwise, it'll reset back to the first weapon.