Garry's Mod

Garry's Mod

Prophunters
Leovigilde 2021 年 11 月 24 日 上午 9:24
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
< >
正在显示第 1 - 2 条,共 2 条留言
daLazyyMan 2022 年 2 月 1 日 上午 4:38 
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 !
最后由 daLazyyMan 编辑于; 2023 年 8 月 31 日 下午 2:33
Leovigilde 2022 年 3 月 19 日 上午 3:30 
God Thanks you
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50