How to make all doors close on Start map ? [DarkRP]

Hello guys,
Can anyone tell me how to make all the doors closed, so players need to LockPick them to enter or buy them, in my DarkRP server?

And thanks you so much.

Haven’t you created this thread like a few days ago?

No

Anyone does know , how to make all doors close on darkrp? please guys…

I am pretty sure I have seen such thread in Dev discussion very recently.

Anyway,



hook.Add( "InitPostEntity", "", function()
	for id, ent in pairs( ents.GetAll() ) do
		if ( ent:isDoor( ) ) then ent:Fire( "Close" ) end
	end
end )