action OPENING 1 9 0 1 0 action CLOSING 1 9 0 -1 0 state open soundonce 450 action OPENING ends state close // (opened) soundonce 455 action CLOSING resetactioncount ends useractor notenemy TEST_DOOR 0 ifpdistl 1024 ifhitspace ifcansee { ifactioncount 0 { state open break } else { ifactioncount 9 { state close } } } enda
Only the first part is working before the else. Once the door is opened, I hear the same opening sound (450) when I hit space, not the closing sound (455). The door doesn't close.
The script executes each time the open state while actioncount should normally be incremented (or I think so).