And I know nearly jack shit about Lua.
I managed to edit the rebel clothes item to make the player “wear” body armor (sets playermodel to Metrocop), and then add a “clothes” item to the player’s inventory when used (and vice versa - when clothes are worn, the body armor item is added and the model is changed to male_02).
That part works flawlessly for now, so I’d like to move on to the part I’ve been having trouble with - the actual armor part.
I hopelessly attempted an autorun script that would check for damage and reduce it if the armor value (from the body armor) wasn’t zero.
Of course, I have no idea if that script is running or not (or if it would even work when it ran, for that matter).
I’ve coded the armor and clothes to correctly update “armorval” (at least I think I did).
(The ply:SetArmor in each was originally how I was going to handle damage calculation, but then realized that I had no way of saving the suit value of each body armor item, so it would end up resetting itself if the player removed the armor then put it back on again.)
And yes, I know the math I did for the failed attempt at damage reduction is stupid, and could be done WAY more efficiently, but that’s not the issue at the moment.
If anybody could give me some advice, or just flat-out tell me what to do, I’d really appreciate it.