Hello. i want to make doors that when you touch them they move up. The problem is that once i touch them, they won't stop moving. I can't seem to figure out what is the problem. Here is the script i have
Active = false
function OnHit(Touch)
if Active == true then return end
Active = true
for i=1,79 do
for _,v in pairs(script.Parent.Parent.Parts:GetChildren()) do
v.CFrame = v.CFrame * CFrame.new(0,0.1,0)
wait(.01)
end
wait(3)
for i=1,79 do
for _,v in pairs(script.Parent.Parent.Parts:GetChildren()) do
v.CFrame = v.CFrame * CFrame.new(0,-0.1,0)
wait(.01)
end
Active = false
end
end
end
script.Parent.Touched:connect(OnHit)
Can someone help me please?

3 comments
That didn't help as i'm trying to move multiple parts. Not just one
put them at all parts lol
I tried that, It still does the same thing.