Garry's Mod

Garry's Mod

Prophunters
Leovigilde 24 Nov, 2021 @ 9:24am
Can I change Playermodels on any .lua file ? For Hunters of Course
Hi guys, I did some modifications on this gamemode but I did not find where I can change the playermodel of HalfLife2 by idk Thanos or Doggo someone have the answer ? Thx btw
< >
Showing 1-2 of 2 comments
DaLazyMan 1 Feb, 2022 @ 4:38am 
In sv_player.lua in the gamemode folder, there is some lines of code with addModel("male", "male") or something like that. Replace it with addModel("<the path to your .mdl file>", "{male} or {female}") (without the < > ).

Just below, there is the function GM:PlayerSetModel. You can replace the code in it with :

if ply:Team() == 2 then
ply:SetModel("<the path to your .mdl file for the hunter model/skin>")
elseif ply:Team() == 3 then
local cl_playermodel = ply:GetInfo( "cl_playermodel" )

local playerModel = table.Random(playerModels)
cl_playermodel = playerModel.model

local modelname = player_manager.TranslatePlayerModel( cl_playermodel )
util.PrecacheModel( modelname )
ply:SetModel( <path to your .mdl file> )
ply.ModelSex = playerModel.sex

net.Start("player_model_sex")
net.WriteString(playerModel.sex)
net.Send(ply)
end

That's how I did on my server and it works greatly !
I hope I helped you !
Last edited by DaLazyMan; 31 Aug, 2023 @ 2:33pm
Leovigilde 19 Mar, 2022 @ 3:30am 
God Thanks you
< >
Showing 1-2 of 2 comments
Per page: 1530 50