Garry's ModGarry's ModDarkRP

Restrict Prop Spawning to specific DarkRP Jobs

Lua script to restrict prop spawning to only specific DarkRP jobs on your GMod server.

Restricting prop spawning to only specific job(s)

Create the file: /garrysmod/addons/restrict_prop_spawning/lua/autorun/restrict_prop_spawning.lua

Paste the following code:

restrict_prop_spawning.lua
/* Allowed jobs can spawn props, all others cannot */
local propSpawningJobs = {
[TEAM_BUILDER] = true,
[TEAM_MOBBOSS] = true,
[TEAM_HOBO] = true,
}

hook.Add("PlayerSpawnProp", "JobSpawnPropRestrict", function(ply)
  if not propSpawningJobs[ply:Team()] then return false end
end)

Works with any DarkRP gamemode.

gmod darkrpgmod luaprop spawninggmod job restrictionsgmod server customization

Was this article helpful?

3 Day Refund Guarantee

Ready to launch your GMod server?

Deploy a high-performance GMod server on overclocked hardware in seconds, with full file access, custom settings, and no player slot limits.

Launch My GMod Server