I attempted to make a script (I'm not the best ) that removes all players hats, and constantly checks for hats, But will not remove hats with names from a table.
save{mask1}
plr = script.Parent.Parent.Character
H = plr:WaitForChild("Hat")
H:remove()
elseif H.name == save then
end

4 comments
First, i said i wasnt a good scripter, and i also said i was trying to tableizle names of the hats i dont want to be destroyed.
Then you failed badly on titling. Remove everyones Hat?
i explained in the description
Although this isn't a requesting website, You should be able to do the rest by pure information from wiki.roblox.com