I wrote a reset button that resets player gun configs to a default module defined in each weapon in the game, and it worked. In the old version of the GUI. Currently, It just… doesn’t
As you can see, at first it works. Probaly because the default configuration is separate from the one being edited. The first reset breaks it, though
connections[#connections+1] = gunConstruction.buttons.reset.textLabel.MouseButton1Click:connect(function()
local clone = functionCollection.findWeapon("M4A1"):clone()
workingProperties = functionCollection.copyTable(require(clone.defaultAttachments).mountedAttachments)
clone:destroy()
rebuildGun()
end)
The model shuffling is an attempt to get a fresh table each time the button is pressed. What seems to happen instead is the live configuration just sort of transcends into the default one provided from the module, and on each new require() it just returns the live configuration instead of a fresh, default one.
I’ve attempted fixing this using the small mess shown above and by using copyTable from
This seems to be fixed by literally leaving and re-entering the menu. This fix is aligned with the settings being turned into JSON and read from a stringValue instead of the default module.