Is removing all ents possible on server start?

Hey guys and gals…

So I tried to run this inside PlayerInitSpawn hook and server just crashed instantly when I joined.
I assume its the light entities being removed that makes the server crash, though i’m not sure. (I took a peek inside the minidump created when the server crashed, and found something about gmod shaders…)

( I am trying this on de_dust2 btw )

for k, v in pairs(ents.GetAll()) do
	if v:IsPlayer() == false then 

Thanks in advance!

Don’t just remove all entities like that. Just make a whitelist of what you WANT to remove.