Need some default map props removed and some map props frozen

I have 2 codes 1 removes map props but all of them and thew other freezes all map props all of them but I want them to target only some specific props

This code freezes all map props:
[lua]
hook.Add( “InitPostEntity”, “FreezePropPhysics”, function()
for Key, Entity in pairs( ents.FindByClass( “prop_physics” ) ) do
local PhysicsObject = Entity:GetPhysicsObject()
if ( IsValid( PhysicsObject ) ) then
PhysicsObject:EnableMotion( false )
end
end
end )[/lua]
I only want it to target these models:
models/props/cs_office/computer_keyboard.mdl,
models/props/cs_office/computer_mouse.mdl,
models/props_c17/computer01_keyboard.mdl,
models/props_combine/suit_charger001.mdl,
models/props_combine/health_charger001.mdl,
models/props_c17/chair_office01a.mdl,
models/props_c17/consolebox01a.mdl,
models/props_lab/monitor02.mdl,
models/props/cs_office/Chair_office.mdl,
models/props_wasteland/controlroom_desk001b.mdl

And this is the code that removes the map props:
[lua]
if SERVER then
timer.Create(“cleanshit”, 15, 1, function()
for k, v in pairs(ents.FindByClass(“prop_physics”)) do
if IsValid(v) and v:CreatedByMap() then
v:Remove()
end
end
end)
end[/lua]
I want this code to only target these props:
models/props_borealis/bluebarrel001.mdl,
models/Items/item_item_crate.mdl,
models/props_c17/oildrum001_explosive.mdl,
models/props_junk/cardboard_box002a.mdl,
models/props_junk/cardboard_box002a.mdl,
models/props_junk/cardboard_box001a.mdl,
models/props_junk/cardboard_box003b.mdl,
models/props_junk/cardboard_box003a_gib01.mdl,
models/props_junk/wood_crate002a.mdl,
models/props_junk/wood_crate001a_damaged.mdl,
models/props_junk/wood_crate001a.mdl,
models/props_c17/oildrum001.mdl,
models/props/cs_assault/HandTruck.mdl,
models/vehicle/helicopter.mdl,
models/props_junk/gnome.mdl,

If someone can figure this out then it would be great

Thanks in advace,
Jeromy Han

Store the Models in a table and check if table.HasValue(tablrname, v:GetModel()) before removing thr Props.

Is it possible you can edit the codes for me cause I’m struggeling

For the freezing thing:



local freezeents = {
    "models/props/cs_office/computer_keyboard.mdl", 
    "models/props/cs_office/computer_mouse.mdl", 
    "models/props_c17/computer01_keyboard.mdl", 
    "models/props_combine/suit_charger001.mdl", 
    "models/props_combine/health_charger001.mdl", 
    "models/props_c17/chair_office01a.mdl", 
    "models/props_c17/consolebox01a.mdl", 
    "models/props_lab/monitor02.mdl", 
    "models/props/cs_office/Chair_office.mdl", 
    "models/props_wasteland/controlroom_desk001b.mdl", 
}

hook.Add( "InitPostEntity", "FreezePropPhysics", function()
    for Key, Entity in pairs( ents.GetAll() ) do
        if table.HasValue( freezeents, Entity:GetModel() ) then
            local PhysicsObject = Entity:GetPhysicsObject()
            if ( IsValid( PhysicsObject ) ) then
                PhysicsObject:EnableMotion( false )
            end
        end
    end
end )


For the removing thing:



local removeents = {
    "models/props_borealis/bluebarrel001.mdl", 
    "models/Items/item_item_crate.mdl", 
    "models/props_c17/oildrum001_explosive.mdl", 
    "models/props_junk/cardboard_box002a.mdl", 
    "models/props_junk/cardboard_box002a.mdl", 
    "models/props_junk/cardboard_box001a.mdl", 
    "models/props_junk/cardboard_box003b.mdl", 
    "models/props_junk/cardboard_box003a_gib01.mdl", 
    "models/props_junk/wood_crate002a.mdl", 
    "models/props_junk/wood_crate001a_damaged.mdl", 
    "models/props_junk/wood_crate001a.mdl", 
    "models/props_c17/oildrum001.mdl", 
    "models/props/cs_assault/HandTruck.mdl", 
    "models/vehicle/helicopter.mdl", 
    "models/props_junk/gnome.mdl", 
}

if SERVER then
        timer.Create("cleanshit", 15, 1, function()
	        for k, v in pairs( ents.GetAll() ) do
                        if IsValid(v) and v:CreatedByMap() and table.HasValue( removeents, v:GetModel() ) then
                                v:Remove()
                        end
                end
        end)
end


[editline]6th March 2016[/editline]

[sp]Honestly this is one of the most simple things ever to do so I don’t exactly get why you’re having trouble[/sp]

Large possibility that he’s new.

I am new in making these kind of stuff and I realy appreciate you doing this I’m gonna try if this works but thank you for this

Kindest regards,
Jeromy Han

[editline]6th March 2016[/editline]

The code works but all it still does is removing all the doorgroups does anyone know why it does this?

-snip-

The code shouldn’t have anything to do with door groups, are you sure it isn’t something else?

I tested it. Door groups are not affected.

Thank you everyone your a huge helpand I will try to fix the database I know that is the problem now