VU Community Forums

[Help] Change GunMaster Weapon Preset List

I am trying to edit the GunMaster weapon set. I can get it to the point where it shows the new weapon set in the in-game list, but it will not spawn the players with the correct weapon, just the original weapon

function EditGMGuns(instance)
print(‘Editing Guns’)
local GMKEntData = GunMasterKillCounterEntityData(instance)
GMKEntData:MakeWritable()

for _, wepPreset in pairs(GMKEntData.weaponsPreset) do

  local GMWepPreset = GunMasterWeaponsPreset(wepPreset)
  
  for i, levelinfo in pairs(GMWepPreset.gunMasterLevelInfos) do
  	local newgun = CustomizeSoldierData(ResourceManager:SearchForDataContainer('Gameplay/XP2/GM_Knife'))
  	levelinfo.customizeData = newgun
  end
  
  for i, override in pairs(GMWepPreset.levelOverrides) do			
  	local newgun = CustomizeSoldierData(ResourceManager:SearchForDataContainer('Gameplay/XP2/GM_Knife'))
  	override = newgun
  	
  end

end
end

ResourceManager:RegisterInstanceLoadHandler(Guid(‘F71EE45B-1BB0-4442-A46D-5B079A722230’), Guid(‘F0D72AE2-9243-43D4-9070-E97B53430FB8’), EditGMGuns)
ResourceManager:RegisterInstanceLoadHandler(Guid(‘F58C83A7-C753-4360-A9C0-4E44C79836F8’), Guid(‘2D869E35-5D5F-4256-B876-C85911F0A7D6’), EditGMGuns)