justvibin035
New Coder
Hi all. Code is below (GLUA). Trying to set up the code so that when an npc spawns in-game, it will spawn with a random model pulled from the innies table each time it is spawned. Right now it spawns with a random model once and each npc iteration after is the same model as the first. What can I tweak so that it will spawn with a random model on each iteration?
Code:
local innies = {
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_alfie.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_carl.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_donnie.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_fabrice.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_gilberto.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_islambek.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_john.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_jose.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_michael.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_ray.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_snippy.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_yasser.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/male/innie_yohannes.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/female/innie_dominique.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/female/innie_miia.mdl",
"models/ishi/suno/halo_rebirth/npc/innie/female/innie_razer.mdl"
}
local Category = "URF (Hostile)"
local NPC = {
Name = "Hostile - Rifleman",
Class = "npc_combine_s",
Model = table.Random(innies),
Health = "150",
Weapons = {"tfa_hr_swep_assault_rifle"},
Category = Category
}
list.Set( "NPC", "npc_rifleman_hostile", NPC )