--AduriteVisor
--RedPaintballMask [Adurite Paintball mask]
--AduriteTophat
--AduriteWingedCrown
--AduriteMaskWithGoggles
names={"AduriteVisor","RedPaintballMask","AduriteTophat","AduriteWingedCrown","AduriteMaskWithGoggles"}
script.Parent.Touched:connect(function(hit)
wearing=false
for _,v in pairs(names) do
if hit.Parent:findFirstChild(v) ~= nil then
wearing=true
elseif hit.Parent:findFirstChild(v) == nil and wearing==false then
wearing=false
if hit.Parent:findFirstChild("Humanoid") and wearing==false then
hit.Parent["Humanoid"].Health=0
end
end
end
end)
--------------------------
Basically I made this script in 10 mins, it checks if you are wearing any of the hats in the tables.. but it only works the visor..
any help?
I was expecting the door to not kill anyone if they are wearing any of the hats in the table, but what happens is if they are not wearing "AduriteVisor" they are killed.
|