Disable Touch Open Doors

Hey, I wonder.

Is it possible to detect somone’s touch open doors? And for example, if not correct team, it returns it and the door doesn’t open?
The doors basically are func_door’s


De-compile the map and do it from there.

What do you mean? Like a door system where if you are the right team then the door opens?

wouldn’t you do smoething like

concommand.Add(“door_open”, function( pl )
if pl:GetEyeTrace():IsValid() and pl:GetEyeTrace():GetClass() == “func_door” then
if pl:Team() == TEAM_HERE then
pl:GetEyeTrace().Entity:Fire(“open”, “”)
pl:ChatPrint(“Wrong team, braah”)

You would of course need to make sure the distance is close enough, and all the good stuff. But this should work.

Not completly. The thing is that the map has made, that the doors open when you touch them, not press E on them.

So everyone can pass it. But I want to override it somehow, to make only certain people able to open that door.

You could lock the door with Entity.Fire and use the KeyPress hook to check if the player’s trace is the door then unlock and open. Since you’d probably need the door to close, you could use a timer and have it lock and close.

(This is a pain the buttox)

Perhaps get the positions of all those auto doors, if there’s not too many of them, and check if the player’s position is close to one of them, close enough that they could be touching it. Then do the check if their team is right and there you go.

I’ll just throw this out here if anyone else needs it

6:41 PM - Tobba: ent:SetKeyValue("spawnflags", ent:GetSpawnflags() - ent:GetSpawnflags() & 1024)
6:41 PM - Tobba: There
6:41 PM - Tobba: That'll make the door not open when you touch it
6:41 PM - Blt950: Cool

Edit, uh, its actually GetSpawnFlags not GetSpawnflags