Disabling Player Model Customization Sandbox

How would I go about disabling the ability to change your player model via the context menu? I know you can do this in DarkRP pretty easily via a config file. How would I go about doing this in Sandbox?


Any idea where I could find the correct property?

I’ve asked multiple people about this and I’ve researched it but I cannot find a good way to make it so that players cannot change their player model.

local tag = "restrictmodels"

local PlayerModelsDefault = {
["user"] = "models/player/breen.mdl",
["admin"] = "models/player/soldier_stripped.mdl",
["superadmin"] = "models/player/odessa.mdl"

local ValidModelSimpleNames = {
	["alyx"] = {"models/player/alyx.mdl"},
	["barney"] = {"models/player/barney.mdl"},
	["breen"] = {"models/player/breen.mdl"},
	["charple"] = {"models/player/charple.mdl"},
	["chell"] = {"models/player/p2_chell.mdl"},
	["corpse"] = {"models/player/corpse1.mdl"},
	["combine"] = {"models/player/combine_soldier.mdl"},
	["combineprison"] = {"models/player/combine_soldier_prisonguard.mdl"},
	["combineelite"] = {"models/player/combine_super_soldier.mdl"},
	["eli"] = {"models/player/eli.mdl"},
	["gman"] = {"models/player/gman_high.mdl"},
	["kleiner"] = {"models/player/kleiner.mdl"},
	["grigori"] = {"models/player/monk.mdl"},
	["mossman"] = {"models/player/mossman.mdl"},
	["mossmanarctic"] = {"models/player/mossman_arctic.mdl"},
	["police"] = {"models/player/police.mdl"},
	["girlpolice"] = {"models/player/police_fem.mdl"},
	["magnusson"] = {"models/player/magnusson.mdl"},
	["stripped"] = {"models/player/soldier_stripped.mdl"},
	["zombie"] = {"models/player/zombie_classic.mdl"},
	["fastzombie"] = {"models/player/zombie_fast.mdl"},
	["malerebel"] = {
	["malecitizen"] = {
	["girlrebel"] = {
	["girlcitizen"] = {
	["skeleton"] = {"models/player/skeleton.mdl"},
	["terrorist"] = {
	["counterterrorist"] = {

local changedmodels = changedmodels or {}

local function defaultsetmodel(ply)
	timer.Simple(0.1, function()
		for g, m in pairs (PlayerModelsDefault) do
			if (g == ply:GetUserGroup()) then
				ply:SetModel(changedmodels[ply:SteamID()] or PlayerModelsDefault[g])

hook.Add("PlayerSpawn", tag, defaultsetmodel)

local function changemodel(ply, text)
	local exptext = string.Explode(" ", text)
	if (string.lower(exptext[1]) == "!model") then
		local wanted = exptext[2]
		if (ValidModelSimpleNames[wanted]) then
			changedmodels[ply:SteamID()] = ply:GetModel()
			ply:PrintMessage(HUD_PRINTTALK, "Not a valid model! Type !models for a list of possible models.")
	if (string.lower(exptext[1]) == "!models") then
		local getkeys = table.GetKeys(ValidModelSimpleNames)
		ply:PrintMessage(HUD_PRINTTALK, "Type !model and then one of the following: 
"..table.concat(getkeys, ", "))

hook.Add("PlayerSay", tag, changemodel)

Just modified something I use on my server (so it doesn’t use CAT functions). If it doesn’t work it should be pretty easy to fix.

Thanks but thats not exactly what I need. I’ll explain more in depth. I’d like to just disable changing your player model in general through the context menu or through any console command (if there is one) because I’m adding player models to the pointshop but I cannot figure out how to disable players from changing their player models.

If you want and you are using ULX you can add teams to every user group, then set a default model for each of the teams. This will prevent players from changing their playermodel via the context menu, but it will still allow them to equip models from the pointshop.