Answered by
6 years ago Edited 6 years ago
For lines 30, 32 and 34, you cannot do LockDownCards[1 or 2 or 3]
because the game will then have to choose the first option in the 1 or 2 or 3
part, which is 1
. It would be the same as saying LockDownCards[1]
. To read more about the or
operator, click here. There is another way to check this, of course.
02 | function checkForLockDownParent(Part) |
03 | for i, cardName in pairs (LockDownCards) do |
04 | if Part.Parent.Name = = cardName then |
12 | function Activated(Part) |
13 | if DoorIsOpen = = false and DoorIsBusy = = false and LockDown_Enabled = = false and Clearances [ Part.Parent.Name ] then |
15 | elseif DoorIsBusy = = false and DoorIsOpen = = true and LockDown_Enabled = = false and Clearances [ Part.Parent.Name ] then |
17 | elseif DoorIsBusy = = false and LockDown_Enabled = = true and checkForLockDownParent(Part) = = false and Clearances [ Part.Parent.Name ] then |
19 | elseif DoorIsBusy = = false and LockDown_Enabled = = true and DoorIsOpen = = false and checkForLockDownParent(Part) and Clearances [ Part.Parent.Name ] then |
21 | elseif DoorIsBusy = = false and LockDown_Enabled = = true and DoorIsOpen = = true and checkForLockDownParent(Part) and Clearances [ Part.Parent.Name ] then |
I hope this will solve your problem. Comment if you have any questions. Thanks.