How can I cut down the amount of lines while keeping the same functionality?

For context this is part of a HUD UI for my mecha game. And there are 4 hardpoints where you can fit weapons and each weapon also has different modes which need to be displayed. Currently I use several if statements to output the correct values however in my experience from unity they have a system where you can directly reference other objects and act accordingly on those references. My issue here is how long the code is and using several what I find to be unnecessary if statements. Is there any way for me to cut down code like this?

local function updateHUD()
	task.wait(.05)
	--print(Gun:GetAttribute("Mode"))
	if Gun:GetAttribute("Hardpoint") == "LH" then
		--print(Gun:GetAttribute("Mode"))
		if Mode.Value == "Alt" then
			--print("Switched to Alt")
			HUD.ARML.AMMO.Text = Gun.AltAmmo.Value
			HUD.ARML.MODE.FIREMODE.Text = Settings.ALT_AMMO_TYPE
		elseif Mode.Value == "Safe" then
			--print("Switched to Safe")
			HUD.ARML.AMMO.Text = "----"
			HUD.ARML.MODE.FIREMODE.Text = "SAFE"
		elseif Mode.Value == "Pri" then
			--print("Switched to Pri")
			HUD.ARML.AMMO.Text = Gun.PriAmmo.Value
			HUD.ARML.MODE.FIREMODE.Text = Settings.AMMO_TYPE
		end
	elseif Gun:GetAttribute("Hardpoint") == "RH" then
		--print(Gun:GetAttribute("Mode"))
		if Mode.Value == "Alt" then
			--print("Switched to Alt")
			HUD.ARMR.AMMO.Text = Gun.AltAmmo.Value
			HUD.ARMR.MODE.FIREMODE.Text = Settings.ALT_AMMO_TYPE
		elseif Mode.Value == "Safe" then
			--print("Switched to Safe")
			HUD.ARMR.AMMO.Text = "----"
			HUD.ARMR.MODE.FIREMODE.Text = "SAFE"
		elseif Mode.Value == "Pri" then
			--print("Switched to Pri")
			HUD.ARMR.AMMO.Text = Gun.PriAmmo.Value
			HUD.ARMR.MODE.FIREMODE.Text = Settings.AMMO_TYPE
		end
	elseif Gun:GetAttribute("Hardpoint") == "LP" then
		--print(Gun:GetAttribute("Mode"))
		if Mode.Value == "Alt" then
			--print("Switched to Alt")
			HUD.PYLONL.AMMO.Text = Gun.AltAmmo.Value
			HUD.PYLONL.MODE.FIREMODE.Text = Settings.ALT_AMMO_TYPE
		elseif Mode.Value == "Safe" then
			--print("Switched to Safe")
			HUD.PYLONL.AMMO.Text = "----"
			HUD.PYLONL.MODE.FIREMODE.Text = "SAFE"
		elseif Mode.Value == "Pri" then
			--print("Switched to Pri")
			HUD.PYLONL.AMMO.Text = Gun.PriAmmo.Value
			HUD.PYLONL.MODE.FIREMODE.Text = Settings.AMMO_TYPE
		end
	elseif Gun:GetAttribute("Hardpoint") == "RP" then
		--print(Gun:GetAttribute("Mode"))
		if Mode.Value == "Alt" then
			--print("Switched to Alt")
			HUD.PYLONR.AMMO.Text = Gun.AltAmmo.Value
			HUD.PYLONR.MODE.FIREMODE.Text = Settings.ALT_AMMO_TYPE
		elseif Mode.Value == "Safe" then
			--print("Switched to Safe")
			HUD.PYLONR.AMMO.Text = "----"
			HUD.PYLONR.MODE.FIREMODE.Text = "SAFE"
		elseif Mode.Value == "Pri" then
			--print("Switched to Pri")
			HUD.PYLONR.AMMO.Text = Gun.PriAmmo.Value
			HUD.PYLONR.MODE.FIREMODE.Text = Settings.AMMO_TYPE
		end
	end
end

my gut is telling me that those if statements are necessary. But you could ig separate them into other smaller functions if u don’t like looking at that many if statements

It just feels like there should be an easier way that im somehow not seeing

How did this completely go over my head? Roblox does have object values for references!

I think putting the innermost if statements into a function and then using it would be the way to go (I just now realized that they’re all the same if statements)