Remove all entities with a given type

How do I do this? I tried this:
[lua]
for _, ent in pairs(ents.GetAll()) do
if ent:GetClass() == “LuaScoreboard” then ent:Remove() end
end
[/lua]
but it doesn’t work…

You sure that it’s the right classname? **[Entity.GetClass

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.GetClass)** returns the class names in lowercase in my experience, you might want to try using “luascoreboard” instead.

But when I do ents.Create( “LuaScoreboard” ) it works fine.

[lua]
for k, v in pairs( ents.FindByClass(“LuaScoreBoard”) ) do
SafeRemoveEntity(v);
end;
[/lua]

Omg I love you

You’re welcome.