• Convar not being created
    6 replies, posted
I've been working on my HUD, and it's ready to be released to the workshop, but since players can't edit the lua files since it's an addon subscribed by the workshop, I'm trying to make a convar. sv_hud.lua [CODE]CreateConVar("nook_hud_ttt", "0")[/CODE] cl_hud.lua [CODE]local NookHud = GetConVar("nook_hud_ttt"):GetInt()[/CODE] I get this error though: [CODE][ERROR] addons/nook_hud/lua/autorun/client/cl_hud.lua:26: attempt to index a nil value 1. unknown - addons/nook_hud/lua/autorun/client/cl_hud.lua:26[/CODE] I'm not sure what to do, since I'm getting frustrated. The reason I have it getting the ConVar in the client is parts of the HUD depend on what they want it for, whether TTT or Sandbox. [b]Edit:[/b] Thanks to Humility to pointing out my poor word choice. Changed the first sentence up a bit.
[QUOTE=Nookyava;41946620]I've been working on my HUD, and it's ready to be released to the workshop, but since players can't edit the lua files since it's an addon[/QUOTE] Just a correction, anyone can modify an addon
[QUOTE=Humility;41946656]Just a correction, anyone can modify an addon[/QUOTE] They can, even though it's subscribed through the workshop? Ah, I probably worded that wrong.
[QUOTE=Nookyava;41946681]They can, even though it's subscribed through the workshop? Ah, I probably worded that wrong.[/QUOTE] As much as they can't edit the workshop file itself, they can decompile the gma and edit the files inside it and finally load the addon as a clientside one
[QUOTE=Humility;41946718]As much as they can't edit the workshop file itself, they can decompile the gma and edit the files inside it and finally load the addon as a clientside one[/QUOTE] True, but how many will actually want to do that? I mean most probably will, but I'd rather try and go to all.
[CODE]CreateConVar("nook_hud_ttt", 0)[/CODE] You were trying to write a ConVar with a string as the variable.
[QUOTE=Nopari;41949871][CODE]CreateConVar("nook_hud_ttt", 0)[/CODE] You were trying to write a ConVar with a string as the variable.[/QUOTE] Wow... I am a moron... Thank you.
Sorry, you need to Log In to post a reply to this thread.