In my game, there are parts with toxic fumes that require a gasmask to pass through. (undamaged, that is) But, I dont know how to make it so that if a player is wearing a gasmask, then the toxic fumes wont damage him. I don't know if this is necessary (or even helps) but I'm new here on this site, so some things that may or may not help: The gas mask is currently a hat, and the fumes are basic bricks that are scripted to do damage when touched.
--Define the player --Define the players character if character:findFirstChild("GasMask") then --stuff end
If there is something touching the gas then search for a humanoid. If there is a humanoid then check if they have a gas mask. If they don't, make a debounce and deal damage to the humanoid, wait a set time, then set the debounce back.