How to tell if a part is not being touched?
I have a door that slides open when you touch a certain part, and closes automatically after 5 seconds. Problem is, I want it to close only if that part is not being touched. Is there a way to say something like:
1 | if Part.Touched ~ = true then |
or something similar? (Assume Part is the part that you touch to open the door.) This is my current script:
01 | door = script.Parent.Parent.DoorSlide |
02 | isOpen = script.Parent.Parent.IsOpen.Value |
06 | if Debounce then return end |
07 | if isOpen = = false then |
10 | door.CFrame = door.CFrame + Vector 3. new(- 0.05 , 0 , 0 ) |
21 | door.CFrame = door.CFrame + Vector 3. new( 0.05 , 0 , 0 ) |
29 | script.Parent.Touched:connect(MoveOpen) |
Any help would be appreciated, even if the answer is quite obvious.