Garry's Mod

Garry's Mod

Garry's Mod Stranded
Polar 2017 年 1 月 9 日 下午 8:49
Custom Spawnable NPCS
I've seen servers with custom npcs that roam during the day. How would I go around adding something like that?

I see the lists for lootable NPCS -
GMS.LootableNPCs = { "npc_antlion", "npc_antlionguard", "npc_crow", "npc_seagull", "npc_pigeon", "npc_zombie" }

But I for some reason cannot find where you call to have zombies spawn. Any help?

EDIT:

Okay, so i found where zombies get spawned but the zombies are spawned based on the time of day and then roam to find enemies right?

for i = 0, math.random( 2, 6 ) do local zombies = #ents.FindByClass( "npc_zombie" ) local fzombies = #ents.FindByClass( "npc_fastzombie" ) if ( zombies + fzombies > 14 ) then break end local pos = Vector( math.random( -6000, 6000 ), math.random( -6000, 6000 ), 1800 ) local tr = util.TraceLine( { start = pos, endpos = pos - Vector( 0, 0, 9999 ) } ) if ( tr.HitWorld ) then local class = "npc_zombie" if ( math.random( 0, 100 ) < 25 ) then class = "npc_fastzombie" end local zombie = ents.Create( class ) zombie:SetPos( tr.HitPos + Vector( 0, 0, 64 ) ) zombie:SetHealth( 128 ) zombie:SetNWString( "Owner", "World" ) zombie:SetKeyValue( "spawnflags", "1280" ) zombie:Spawn() zombie:Fire( "Wake" ) zombie:Activate()


最后由 Polar 编辑于; 2017 年 1 月 9 日 下午 8:55
< >
正在显示第 1 - 2 条,共 2 条留言
LowTierAether 2017 年 3 月 25 日 上午 8:18 
i dont know.
psychicweaver 2017 年 7 月 4 日 下午 12:19 
i dont know.

the literally ♥♥♥♥ off
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50