Garry's Mod

Garry's Mod

[ANP] Global Defence Force
out-dis-bih 2022년 11월 26일 오후 1시 00분
What are the npc spawn names?
for example, 'npc_combine_s' or 'npc_citizen'

copying from the spawn menu the names are '[GDF] Soldier' and '[GDF] Captain' etc but using those names only spawns default hl2 citizen skins when inputted.

thanks in advance.
< >
전체 댓글 1개 중 1~1개 표시 중
Teniente Coronel 2023년 1월 27일 오후 6시 29분 
The mod usses the "Name" system, meaning that in order to spawn one of the GDF NPCs, you first have to spawn npc_citizen and then set their name to GDF xxxx.
Honestly I do not know how to do it from in game, howhever, by coding, Ihave come to this :

function replacement()
for k, v in pairs( ents.FindByClass( "npc_citizen" ) ) do

local chance = math.Rand(1,100)
if chance > 75 then
v:SetName("[GDF] Soldier")
end
end

end

It first discovers the npc_citizen, and then, by chance, it replaces them with the GDF
< >
전체 댓글 1개 중 1~1개 표시 중
페이지당 표시 개수: 1530 50