Extended Health Armor thing

Ok so I’m not sure why this happens, but anyways, my script for this armor tool basicly is supposed to change the user’s max health. The healthbar thing does change the value, but when the player gets damaged, it acts like the armor extra health isn’t even there. The helmet and vest together add extra 80 max health, and the damage part does 50 damage. So in theory, I can take 4 hits before dying. But instead, I die after only two.

before bruh armor

code:

local tool=script.Parent
local handle=tool.Handle
local h = tool.Parent:FindFirstChild(“Humanoid”)
local remotefunction=tool.RemoteFunction
local debris=game:GetService(“Debris”)

function remotefunction.OnServerInvoke(player,command,value)
if command==“protect” then
if value[100] then
local currentvest=value[1]:FindFirstChild(“VestArmour”)

		end
		local vest=Instance.new("Hat")
		vest.Name="VestArmour"
		handle:Clone().Parent=vest
		vest.AttachmentPos=Vector3.new(0, 1.8, 0.1)
	vest.Parent=value[1]
	

		
	tool.Handle.Transparency = 1
	tool.Handle.Crowns.Transparency = 1
	tool.Handle.Shield.Transparency = 1
	tool.Handle.Pocket1.Transparency = 1
	tool.Handle.Pocket2.Transparency = 1
	tool.Handle.Pocket3.Transparency = 1
	
	
	wait(2)
	tool.Handle.Transparency = 0
	
		tool.Handle.Crowns:Destroy()
		tool.Handle.Shield:Destroy()
	tool.Handle.Pocket1:Destroy()
	tool.Handle.Pocket2:Destroy()
	tool.Handle.Pocket3:Destroy()
	
	
	
	local h = tool.Parent:FindFirstChild("Humanoid")
	if (h ~= nil) then
		h.MaxHealth = h.MaxHealth + 45
		h.Health = h.Health + 45
		
	
	
	tool:Destroy()
	end
end
end