Seeing if a prop_door_rotating is locked?

Is there a way to see if a given door is locked or not?

Can we know why you need that avaible trough lua? Maybe there’s another way to achieve the same results. is a good place to look for stuff like that.

However, I don’t think there is any way to tell. Sadly, there’s no output for being locked/unlocked either.

Actually, instead of checking whether it’s locked or not, you could use the OnClose and OnOpen outputs to check whether the activator should be able to go inside (if not, then you fire the Lock input).

I’ve found a way! Based on the help I got with this, I can get the spawnflags which can tell me if it started locked (which is all I needed to know).

How are you going to get whether it has an individual spawnflag though?


All the doors I want use a certain flag ( 34816 ), but you could work out each flag like this:
[lua]spawnflag = (whatevever)
tempflag = spawnflag
flags = {}
for i = 1, maxflags do
local j = math.pow( 2, i )
if tempflag / j == math.floor( tempflag / j ) then
tempflag -= j / 2
flags[ i ] = true
flags[ i ] = false
I didn’t really think that through so it may be wrong