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

Questions?

Join over 6000+ members in our Discord community chat with other server owners, get help, and stay up to date with the latest news.