Garry's Mod

Garry's Mod

Star Wars: Rebel Troopers
 此主题已被置顶,因此可能具有重要性
Captain Charles  [开发者] 2016 年 2 月 20 日 下午 5:45
NPC Not Working
Hello, and thank you for subscibing to this addon. I wanted to write this post to say that for some reason, the NPCs on this addon are currently broken. I'm not sure why they aren't working, but I'm trying to get help fixing them.

This will probably be the ONLY addon I release that will include NPCs since I am okay with these rebels using standard rebel AI.
< >
正在显示第 1 - 3 条,共 3 条留言
kev675243 2016 年 2 月 23 日 下午 3:58 
Do you want me to help you out? I am more than willing to help fix the npcs
Captain Charles  [开发者] 2016 年 2 月 23 日 下午 8:41 
Sure, This is what I have in the autorun currently. This should call for the model but also randomize which one is spawned.

Standard male 1 through 9
local NPC = { Name = "Rebel Trooper Captain", Class = "npc_citizen", Model = "models/SGG/Starwars/Rebels/r_trooper_captain/male_01.mdl", Category = Category, SpawnFlags = SF_CITIZEN_RANDOM_HEAD, KeyValues = { citizentype = CT_REBEL, trooper_captain = 1 }, Weapons = { "weapon_pistol", "weapon_ar2", "weapon_smg1", "weapon_ar2", "weapon_shotgun" } } list.Set( "NPC", "Rebel_trooper_captain", NPC ) hook.Add("PlayerSpawnedNPC", "trooper_captain_initmodel", function(pl, npc) if IsValid(npc) then local keyValues = npc:GetKeyValues() if keyValues["trooper_captain"] then local nTrooper = tonumber(keyValues["trooper_captain"]) if nTrooper == 1 then npc:SetModel("models/SGG/Starwars/Rebels/r_trooper_captain/male0" .. math.random(1,9) .. ".mdl") end end end end)

Standard males 1 - 9 but with two extra races added, which brings it up to 11.
local NPC = { Name = "Rebel Soldier (Forest)", Class = "npc_citizen", Model = "models/SGG/Starwars/Rebels/r_soldier_forest/male_01.mdl", Category = Category, SpawnFlags = SF_CITIZEN_RANDOM_HEAD, KeyValues = { citizentype = CT_REBEL, trooper_soldier_forest = 1 }, Weapons = { "weapon_pistol", "weapon_ar2", "weapon_smg1", "weapon_ar2", "weapon_shotgun" } } list.Set( "NPC", "Rebel_soldier_forest", NPC ) hook.Add("PlayerSpawnedNPC", "soldier_forest_initmodel", function(pl, npc) if IsValid(npc) then local keyValues = npc:GetKeyValues() if keyValues["soldier_forest"] then local nTrooper = tonumber(keyValues["soldier_forest"]) if nTrooper == 1 then local nRand = math.random(1,11) npc:SetModel("models/SGG/Starwars/Rebels/r_soldier_forest/male" .. (nRand < 10 && "0" || "") .. nRand .. ".mdl") end end end end)
最后由 Captain Charles 编辑于; 2016 年 2 月 23 日 下午 8:41
lucfle97 2016 年 8 月 20 日 下午 8:52 
There's a person who contributes to the lazarus rp server who reuploaded this addon with working npc's. maybe you should contact her for help on it. I think it's a she
here's the addon
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=685331561
最后由 lucfle97 编辑于; 2016 年 8 月 20 日 下午 8:54
< >
正在显示第 1 - 3 条,共 3 条留言
每页显示数: 1530 50