I am looking for a way to Open/Close doors vie one command. I have the start of a command but there is one part that I need.
How am I able to tell if a door is in the open or closed position?
Here was my attempt:
[CODE]AddStickTool("Open/Close Door (WIP)", {
Description = "Opens/Closes target door",
Icon = "icon16/door.png",
CanTarget = function(ent)
local class = ent:GetClass()
if (class == "func_door") or (class == "prop_door_rotating") then
return true
end
return false
end,
OnRun = function(Player, Trace)
if (Trace.Entity:GetSaveTable().m_bOpen) then
Trace.Entity:Fire("Unlock", "", 0)
Trace.Entity:Fire("Close", "", 0.1)
Stick_SendChat(Player, "Door Closed")
else
Trace.Entity:Fire("Unlock", "", 0)
Trace.Entity:Fire("Open", "", 0.5)
Stick_SendChat(Player, "Door Opened")
end
end
})
[/CODE]
I was sure that "if (Trace.Entity:GetSaveTable().m_bOpen) then" Would not work because I am almost positive "m_bOpen" Is not a thing. All I need is a way to see if a door is Open. Thank you.
Lol so i made sure m_bOpen is not a thing so that sucks. Any help?
m_eDoorState incase of prop doors and m_toggle_state for func doors.
iirc state 1 or 2 was open, the other was opening
[QUOTE=Tomelyr;50395902]m_eDoorState incase of prop doors and m_toggle_state for func doors.
iirc state 1 or 2 was open, the other was opening[/QUOTE]
I love you! Thanks!
Sorry, you need to Log In to post a reply to this thread.