• two entities as duplicate
    7 replies, posted
Hello, i have 2 Entities 1 Armor npc and 1 Health npc when i have both installed in my lua/entities one of the npc get nil and giving errors depends witch one i spawn first and the other one work perfect but if i separates them and remove health NPC its working perfect and if i remove health and put in armor npc works perfect but when both are installed in lua/entities one of them giving error i do not know why and they spawning with same models that i haven't tell them todo Armor npc have VConfig.model = "models/Barney.mdl" And health NPC have VConfig.model = "models/Humans/Group03m/male_09.mdl" And the funny part is they are in diffrent folders aswell [ERROR] lua/includes/modules/draw.lua:141: bad argument #1 to 'gmatch' (string expected, got nil)   1. gmatch - [C]:-1    2. DrawText - lua/includes/modules/draw.lua:141     3. unknown - addons/armor/lua/entities/armor/cl_init.lua:183 This is line 183 draw.DrawText( VConfig.Buy100Armor, "Arial4",0 + 205 ,3,Color(VConfig.TextHeaderColor.r,VConfig.TextHeaderColor.g,VConfig.TextHeaderColor.b,VConfig.TextHeaderColor.a),0 )
Not sure about the problem, but i just have to ask... 0 + 205 why
I have hardcoded a bit sorry about that xD
VConfig.Buy100Armor is nil.
I dont understand how it can be nil when i do not have Health npc installed in my garrys mod files
You're either not setting it or overriding VConfig after you've set it. For the models being the same on either entity you should use a local variable or a more unique key in VConfig to store the model path. Just because you're setting it in a different file doesn't mean it won't override the other one. You should read how tables work: https://www.lua.org/pil/2.5.html
What does that have to do with the variable being nil?
I though that was sarcasm
Sorry, you need to Log In to post a reply to this thread.