DarkRP Disable Prop Spawning for users only?

Is there any way to only allow prop spawning for admins or superadmins etc (I’m using ULX) in DarkRP or just in general. I know it’s a weird request seeing as building is a key part in normal DarkRP but I’m making a Serious RP server (won’t go into detail) and I could really use not having people running around spawning props. I’d like to say thanks beforehand for anyone who’s willing to help me with this :slight_smile:

Use the PlayerSpawnProp hook and check the spawner’s user group.

Can you expand more on that please I’m very new to lua



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


Stick it somewhere serverside.

Alternatively if you want to stop spawning all together:



local hooks = {
    "Effect",
    "NPC",
    "Prop",
    "Ragdoll",
    "SENT",
    "Vehicle"
}


for _, v in pairs (hooks) do


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


Worked thanks!