Admin+ only spawning props?

Hi All.

I have searched long and hard through the FacePunch forums, and I have come to no resolution.

Basically, I want to make it so ONLY people with certain groups can spawn props. I found the command:



hook.Add("PlayerSpawnProp", "Disallow_user_props", function(client)
    if (client:IsUserGroup("admin") or client:IsUserGroup("superadmin")) then
        return true
    end
    
    return false
end)

But I have no idea where to stick it in the .cfg files.

Any help would be greats appreciated!

This is not a command, this is a lua code.

You would have to put it in lua/autorun/server

Better



hook.Add("PlayerSpawnProp", "Disallow_user_props", function(client)
    return (client:IsUserGroup("admin") or client:IsUserGroup("superadmin"))
end)