• Close all doors on the map, except few
    4 replies, posted
Hi there. Pretty much I have to find way to close all droors on the map, except for a few ones. More importantly I have to do this ever 30 or so seconds. First attempt was to make something like this: timer.Create("DOORSTUCK!!", 60, 0, function()  for k,v in pairs(ents.GetAll()) do if v:GetClass() ==  "func_door" and v:GetPos() != Vector(832, -2244.5, 55.5) or v:GetPos() != Vector(832,420.5,55.5) then      v:Fire("Close") end     end end) Worked, but all doors are closing themselfs, even ones I've excluded Second attempt was with a help of my friend, he suggested to get MapEntityID local whitelist = { [IDsHere] = true, } timer.Create("DOORSTUCK!!", 60, 0, function()  for k,v in pairs(ents.GetAll()) do if v:GetClass() ==  "func_door" and !whitelist[v:MapCreationID()] then      v:Fire("Close") v:Fire("unlock") end     end end) And still no luck. Any Ideas?
You're definitely heading in the right direction with your second attempt. I've tested the code from this and it appears to work in my context. Are you sure it is being run correctly, and run serverside? What is actually happening with the second piece of code? Are all doors still closing or none of them?
Yeah. Just checked this out one more time, still every single door is closing, even excluded ones. Well considering we are planing to use it on gm, I thought that something in gamemode itself might overwrite it, but nope. Just placed it into autorun\server and still no luck, every door is closing itself. I dont know, maybe you can check it out on the map we are using, since if its working for you, there are two possible ways: we are doing something wrong or there is something wrong with the map. Here is the map
I will run a quick test now.
Pretty much this. I also had an idea that this might have coased the problems. Many thanks for your and your time m8
Sorry, you need to Log In to post a reply to this thread.