Unlock all doors on a map when map is loading

Can anybody make me a .lua script that unlocks ALL doors on the map when the map starts? Cause rp_downtown_v2 got a bug…most of the doors are locked.

[lua]
hook.Add(“InitPostEntity”, “UnlockDoors”, function()
for k, v in pairs( ents.GetAll() ) do
if v:GetClass() == “prop_door_rotating” then
v:Fire(“unlock”)
end
end
end )
[/lua]

[lua]local doors = {
func_door = true,
func_door_rotating = true,
}

hook.Add(“InitPostEntity”, “UnlockAllDoors”, function()
for _, ent in ipairs(ents.GetAll()) do
if doors[ent:GetClass()] then
ent:Fire(“unlock”)
end
end
end)[/lua]

[editline]05:44PM[/editline]

:ninja:

You’re missing a ) on the last end

:chef:

FUUUUUUU

thanks for pointing that out.

it somehow locked all doors, lol. what now?

Edit: It works now, I removed the “local doors” thingy.