Garry's Mod

Garry's Mod

Star Wars: Rebel Troopers
 This topic has been pinned, so it's probably important
Captain Charles  [developer] 20 Feb, 2016 @ 5:45pm
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.
< >
Showing 1-3 of 3 comments
kev675243 23 Feb, 2016 @ 3:58pm 
Do you want me to help you out? I am more than willing to help fix the npcs
Captain Charles  [developer] 23 Feb, 2016 @ 8:41pm 
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)
Last edited by Captain Charles; 23 Feb, 2016 @ 8:41pm
lucfle97 20 Aug, 2016 @ 8:52pm 
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
Last edited by lucfle97; 20 Aug, 2016 @ 8:54pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50