I didn't had time to fix. Never used pedClothes before.
local gasMaskActivation = function (player)
local texture,model = getPedClothes ( player, 15 )
if not (texture == "hockey" and model == "hockeymask") then
addPedClothes ( player, "hockey", "hockeymask", 15 )
else
removePedClothes ( player, 15 )
end
end
addEventHandler ("onPlayerLogin",root,
function()
bindKey (source,"h","up",gasMaskActivation)
end)
addEventHandler ("onPlayerLogout",root,
function()
if isKeyBound ( source,"h","up",gasMaskActivation ) then
unbindKey (source,"h","up",gasMaskActivation)
end
end)