More specifically, everything in this script works, except the else part.
local part = script.Parent
local db = false
local myVar = game.Workspace.Part.SurfaceGui.Test
function FindHat(hit)
local hat = hit.Parent:FindFirstChild("SilverthornAntlers")
local human = hit.Parent:FindFirstChild("Humanoid")
if human and hat then
if not db then
db = true
myVar.Text = ("HOW DARE YOU WEAR THAT WRETCHED HAT!?")
wait(4)
myVar.Text = ("YOU WILL BE SMITED BY MY WRATH!")
wait(4)
myVar.Text = ("DIE!!")
wait(2)
human.MaxHealth = 0
wait(5)
myVar.Text = (" ")
db = false
else
myVar.Text = ("You're good to go")
end
end
end
part.Touched:connect(FindHat)
So, what the script is supposed to do, is detect if you're wearing a certain hat, and if you're not, then it says "you're good to go!". Everything works if you have the hat, but when I DON'T have it, nothing works. Any help please?
