Garry's Mod

Garry's Mod

Player customizer (non-RP + DarkRP)
 This topic has been pinned, so it's probably important
Cédric GÉRILLE [GiletJaune]  [developer] 27 May, 2016 @ 11:33am
Example of configuration file
To configure restrictions, here is an example file.
Please do not ask for help if you do not understand how to use it.
Save this file as garrysmod/lua/autorun/player_customizer_spawn.cfg.lua
-- This configuration script is compatible with Lua refresh. local function ColorToVector( color ) return Vector( color.r/255,color.g/255,color.b/255 ) end player_customizer_spawn = player_customizer_spawn or {} function player_customizer_spawn.LoadConfig() -- BEGIN CONFIGURATION -- For each model, you can set either a table or a boolean (false: disallow model, true: add model to list). -- Only specify members of a table that you want to restrict. player_customizer_spawn.RestrictionsModels = { ["models/player/dod_american.mdl"] = { bodygroups = { [0] = {2,3,5}, [1] = {1}, }, playercolor = Vector(1,1,1), skin = {0}, }, ["models/player/dod_german.mdl"] = { bodygroups = { [0] = {3,4}, }, }, ["models/player/mossman.mdl"] = { playercolor = Vector(0.75,0,0.75), }, ["models/player/skeleton.mdl"] = { skin = {0,1}, }, ["models/player/zombie_classic.mdl"] = false, ["models/player/zombie_fast.mdl"] = false, ["models/player/zombie_soldier.mdl"] = false, ["models/props_combine/breenbust.mdl"]=true, } -- AllowUnlistedModels: allow models that you have not listed in the table; default is false, except DarkRP -- For each model, you can set either a table (identical to RestrictionsModels) or a boolean (allow model). -- Every listed model with a table replaces parameters from RestrictionsModels. player_customizer_spawn.RestrictionsTeams = { [TEAM_UNASSIGNED] = { AllowUnlistedModels = false, ["models/player/dod_american.mdl"] = { bodygroups = { [0] = {1}, [1] = {1}, }, playercolor = Vector(1,1,1), skin = {0}, }, ["models/player/dod_german.mdl"] = { bodygroups = { [0] = {1}, }, playercolor = Vector(1,1,1), }, ["models/props_c17/doll01.mdl"]=true, }, } -- END CONFIGURATION end
Last edited by Cédric GÉRILLE [GiletJaune]; 20 Nov, 2016 @ 4:44pm