function onTouched(hit)
if hit.Name == "H1" then
if script.Parent.Parent.DoorL.Value == false then
script.Parent.Parent.DoorL.Value = true
wait(60)
script.Parent.Parent.DoorL.Value = false
end
end
script.Parent.Parent.Touched:connect(onTouched)
COMMUNITY QUESTION
what wrong with this script?
1 answer
You are missing an end. You need an end for the function and one for each of the if statements.
function onTouched(hit)
if hit.Name == "H1" then
if script.Parent.Parent.DoorL.Value == false then
script.Parent.Parent.DoorL.Value = true
wait(60)
script.Parent.Parent.DoorL.Value = false
end
end
end
script.Parent.Parent.Touched:connect(onTouched)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Tested,failed
Is your hierarchy correct? I cannot tell if it is not sorry
just note